Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update rust crate fluence-spell-dtos to 0.6.0 - abandoned #118

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions src/distro/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/distro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ include = [ "/src", "built.rs", "Cargo.toml", "decider-spell" ]
[dependencies]
maplit = "1.0.2"
serde_json = "1.0.96"
fluence-spell-dtos = "0.5.31"
fluence-spell-dtos = "0.6.0"

[build-dependencies]
built = "0.7.0"
31 changes: 22 additions & 9 deletions src/tests/decider-distro-tests-rs/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/tests/decider-distro-tests-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ toml = "0.5.10"
maplit = "1.0.2"
serde_json = "1.0.96"
serde = { version = "1.0.192", features = ["derive"] }
fluence-spell-dtos = "0.5.31"
fluence-spell-dtos = "0.6.0"
mockito = "1.1.0"
hyper = "0.14.27"
eyre = "0.6.9"
20 changes: 10 additions & 10 deletions src/tests/decider-distro-tests-rs/tests/test_deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ async fn test_deploy_a_deal_single() {
!counter.absent,
"decider hasn't started yet (no counter in kv)"
);
assert_eq!(counter.num, 1, "decider wasn't run");
assert_eq!(counter.value, 1, "decider wasn't run");

// Analyse joined deals
let deal = {
Expand Down Expand Up @@ -331,9 +331,9 @@ async fn test_deploy_deals_diff_blocks() {
let last_seen = serde_json::from_value::<StringValue>(result.remove(0)).unwrap();

let deals = serde_json::from_value::<StringListValue>(result.remove(0)).unwrap();
assert_eq!(deals.strings.len(), 2);
assert_eq!(deals.value.len(), 2);
let deals = deals
.strings
.value
.iter()
.map(|deal| serde_json::from_str::<JoinedDeal>(deal).unwrap())
.collect::<Vec<_>>();
Expand All @@ -346,7 +346,7 @@ async fn test_deploy_deals_diff_blocks() {
(last_seen, deals, workers)
};

assert_eq!(last_seen.str, to_hex(LATEST_BLOCK), "wrong last_seen block");
assert_eq!(last_seen.value, to_hex(LATEST_BLOCK), "wrong last_seen block");

let mut expected = hashmap! {
deal_id_1 => (TestApp::test_app1(), BLOCK_NUMBER_1),
Expand Down Expand Up @@ -472,9 +472,9 @@ async fn test_deploy_a_deal_in_seq() {
let last_seen = serde_json::from_value::<StringValue>(result.remove(0)).unwrap();

let deals = serde_json::from_value::<StringListValue>(result.remove(0)).unwrap();
assert_eq!(deals.strings.len(), 2);
assert_eq!(deals.value.len(), 2);
let deals = deals
.strings
.value
.iter()
.map(|deal| serde_json::from_str::<JoinedDeal>(deal).unwrap())
.collect::<Vec<_>>();
Expand All @@ -487,7 +487,7 @@ async fn test_deploy_a_deal_in_seq() {
(last_seen, deals, workers)
};
assert_eq!(
last_seen.str,
last_seen.value,
to_hex(LATEST_BLOCK_SECOND_RUN),
"saved wrong last_seen_block"
);
Expand Down Expand Up @@ -614,9 +614,9 @@ async fn test_deploy_deals_in_one_block() {
let last_seen = serde_json::from_value::<StringValue>(result.remove(0)).unwrap();

let deals = serde_json::from_value::<StringListValue>(result.remove(0)).unwrap();
assert_eq!(deals.strings.len(), 2);
assert_eq!(deals.value.len(), 2);
let deals = deals
.strings
.value
.iter()
.map(|deal| serde_json::from_str::<JoinedDeal>(deal).unwrap())
.collect::<Vec<_>>();
Expand All @@ -630,7 +630,7 @@ async fn test_deploy_deals_in_one_block() {
};
// TODO: difficult logic with last_seen_block, not sure on what circumstances it should be
// incremented and when not
assert_eq!(last_seen.str, to_hex(LATEST_BLOCK), "wrong last seen");
assert_eq!(last_seen.value, to_hex(LATEST_BLOCK), "wrong last seen");

let mut expected = hashmap! {
// It was installed on the first run, so on the second run the window is updated
Expand Down
2 changes: 1 addition & 1 deletion src/tests/decider-distro-tests-rs/tests/test_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ async fn test_update_deal() {
.unwrap();
let result = serde_json::from_value::<StringValue>(result[0].clone()).unwrap();
assert!(!result.absent, "no `worker_def_cid` on worker-spell");
serde_json::from_str::<String>(&result.str).unwrap()
serde_json::from_str::<String>(&result.value).unwrap()
};
let original_app = TestApp::test_app2();
let new_app = TestApp::test_app1();
Expand Down
2 changes: 1 addition & 1 deletion src/tests/decider-distro-tests-rs/tests/tests_basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ async fn test_left_boundary_idle() {
let last_seen = spell::get_string(&mut client, "decider", "last_seen_block")
.await
.unwrap();
assert_eq!(last_seen.str, expected_last_seen[step]);
assert_eq!(last_seen.value, expected_last_seen[step]);
}

server.shutdown().await;
Expand Down
8 changes: 4 additions & 4 deletions src/tests/decider-distro-tests-rs/tests/utils/control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ pub async fn update_decider_script_for_tests(client: &mut ConnectedClient, test_
)
"#,
client = client.peer_id,
script = script.source_code,
script = script.value,
);

modify_decider_spell_script(test_dir, decider_id, updated_script).await;
Expand Down Expand Up @@ -113,7 +113,7 @@ pub async fn wait_worker_spell_stopped(
strings.error
);

if !strings.strings.is_empty() {
if !strings.value.is_empty() {
#[derive(Deserialize, Debug)]
struct State {
state: String,
Expand All @@ -122,7 +122,7 @@ pub async fn wait_worker_spell_stopped(
// HACK: sometimes sqlite returns trash in the requested lists.
// FOR NOW we filter out the trash to avoid parsing errors and CI failures
let last_statuses = strings
.strings
.value
.iter()
.filter_map(|s| serde_json::from_str::<State>(s).ok())
.collect::<Vec<_>>();
Expand All @@ -131,7 +131,7 @@ pub async fn wait_worker_spell_stopped(
.last()
.wrap_err(format!(
"no installation status parsed, got {:?}",
strings.strings
strings.value
))
.unwrap();
let in_progress_statuses = ["INSTALLATION_IN_PROGRESS", "NOT_STARTED"];
Expand Down
6 changes: 3 additions & 3 deletions src/tests/decider-distro-tests-rs/tests/utils/state/deal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub async fn get_deal_state(client: &mut ConnectedClient, deal_id: &String) -> D
"can't get state for deal {}: {}",
deal_id, result.error
);
serde_json::from_str::<DealState>(&result.str)
serde_json::from_str::<DealState>(&result.value)
.wrap_err("parse deal_state")
.unwrap()
}
Expand All @@ -37,7 +37,7 @@ pub async fn get_joined_deals(client: &mut ConnectedClient) -> Vec<JoinedDeal> {
.unwrap();
assert!(deals.success, "empty list of joined_deals: {}", deals.error);
deals
.strings
.value
.iter()
.map(|deal| serde_json::from_str::<JoinedDeal>(deal).unwrap())
.collect()
Expand All @@ -64,7 +64,7 @@ pub async fn get_failed_deals(client: &mut ConnectedClient) -> Vec<FailedDeal> {
.unwrap();
assert!(deals.success, "can't receive failed_deals: {}", deals.error);
deals
.strings
.value
.iter()
.map(|s| serde_json::from_str::<FailedDeal>(s))
.collect::<Result<Vec<_>, _>>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ pub async fn get_sync_info(client: &mut ConnectedClient) -> eyre::Result<SyncInf
return Err(eyre::eyre!("get sync_info failed: {}", result.error));
}

serde_json::from_str::<SyncInfo>(&result.str).wrap_err("parse sync_info")
serde_json::from_str::<SyncInfo>(&result.value).wrap_err("parse sync_info")
}
4 changes: 2 additions & 2 deletions src/tests/decider-distro-tests-rs/tests/utils/state/subnet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub async fn get_txs(mut client: &mut ConnectedClient) -> Vec<WorkerTxInfo> {
"can't receive `worker_registration_txs`: {}",
txs.error
);
txs.strings
txs.value
.iter()
.map(|tx| serde_json::from_str::<WorkerTxInfo>(tx).unwrap())
.collect::<Vec<_>>()
Expand All @@ -41,7 +41,7 @@ pub async fn get_txs_statuses(mut client: &mut ConnectedClient) -> Vec<WorkerTxS
"can't receive `worker_registration_txs_statuses`: {}",
txs.error
);
txs.strings
txs.value
.iter()
.map(|tx| serde_json::from_str::<WorkerTxStatus>(tx).unwrap())
.collect::<Vec<_>>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub async fn get_worker_app_cid(client: &mut ConnectedClient, worker_id: &String
.wrap_err("get_worker_app_cid failed")
.unwrap();
assert!(!result.absent, "worker-spell doesn't have worker_def_cid");
serde_json::from_str::<String>(&result.str).unwrap()
serde_json::from_str::<String>(&result.value).unwrap()
}

pub async fn get_worker(mut client: &mut ConnectedClient, deal: &str) -> Vec<String> {
Expand Down
Loading