Skip to content

Commit

Permalink
Revert "feat(su): boot loader fix test, remove dependency #730"
Browse files Browse the repository at this point in the history
This reverts commit 7027209.
  • Loading branch information
VinceJuliano committed Aug 24, 2024
1 parent 28601a3 commit 91765b6
Show file tree
Hide file tree
Showing 8 changed files with 875 additions and 120 deletions.
895 changes: 867 additions & 28 deletions servers/su/Cargo.lock

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions servers/su/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ default-run = "su"
[dependencies]
actix-web = "4"
async-trait = "0.1.74"
bundlr-sdk = "0.5.0"
reqwest = "0.11.22"
serde = "1.0.188"
serde_json = "1.0.107"
Expand All @@ -33,8 +34,6 @@ futures = "0.3.30"
rocksdb = "0.22.0"
actix-web-prom = { version = "0.8.0", features = ["process"] }
prometheus = { version = "0.13.4", features = ["process"] }
lazy_static = "1.5.0"
avro-rs = "0.13.0"

[[bin]]
name = "su"
Expand Down
2 changes: 1 addition & 1 deletion servers/su/src/domain/core/builder.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::sync::Arc;

use super::tags::Tag;
use bundlr_sdk::tags::Tag;

use super::bytes::{ByteErrorType, DataBundle, DataItem};
use super::dal::{Gateway, Log, ScheduleProvider, Signer, TxStatus};
Expand Down
8 changes: 4 additions & 4 deletions servers/su/src/domain/core/bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::clone::Clone;

use bytes::{BufMut, Bytes};

use super::tags::*;
use bundlr_sdk::{error::BundlrError, tags::*};

use base64_url;
use sha2::{Digest, Sha256, Sha384};
Expand All @@ -14,9 +14,9 @@ pub enum ByteErrorType {
ByteError(String),
}

impl From<TagError> for ByteErrorType {
fn from(error: TagError) -> Self {
ByteErrorType::ByteError(format!("Byte error: {:?}", error))
impl From<BundlrError> for ByteErrorType {
fn from(error: BundlrError) -> Self {
ByteErrorType::ByteError(format!("Byte error: {}", error))
}
}

Expand Down
9 changes: 2 additions & 7 deletions servers/su/src/domain/core/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use serde::{Deserialize, Serialize};
use sha2::{Digest, Sha256};

use super::bytes::{ByteErrorType, DataBundle, DataItem};
use super::tags::*;
use bundlr_sdk::tags::*;

#[derive(Serialize, Deserialize, Debug, Clone)]
pub enum JsonErrorType {
Expand Down Expand Up @@ -803,20 +803,15 @@ mod tests {
#[test]
fn test_from_bundle() {
let d_item_string = PROCESS_ITEM_STR.to_string();
let a_d_item_string = ASSIGNMENT_ITEM_STR.to_string();
let item_bytes = base64_url::decode(&d_item_string).expect("failed to encode data item");
let assignment_item_bytes =
base64_url::decode(&a_d_item_string).expect("failed to encode data item");
let data_item = DataItem::from_bytes(item_bytes).expect("failed to build data item");
let assignment_data_item =
DataItem::from_bytes(assignment_item_bytes).expect("failed to build data item");
let tags = vec![
Tag::new(&"Bundle-Format".to_string(), &"binary".to_string()),
Tag::new(&"Bundle-Version".to_string(), &"2.0.0".to_string()),
Tag::new(&"Block-Height".to_string(), &"100".to_string()),
Tag::new(&"Timestamp".to_string(), &"100".to_string()),
];
let mut data_bundle = DataBundle::new(tags);
data_bundle.add_item(assignment_data_item);
data_bundle.add_item(data_item);
let process = Process::from_bundle(&data_bundle).expect("failed to create process");
assert_eq!(
Expand Down
1 change: 0 additions & 1 deletion servers/su/src/domain/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ mod bytes;
mod builder;
// build json from raw data
mod json;
mod tags;

// traits for injecting dependencies
pub mod dal;
Expand Down
77 changes: 0 additions & 77 deletions servers/su/src/domain/core/tags.rs

This file was deleted.

Binary file modified servers/su/su
Binary file not shown.

0 comments on commit 91765b6

Please sign in to comment.