Skip to content

Commit

Permalink
Update rust version (#2139)
Browse files Browse the repository at this point in the history
Co-authored-by: gix-bot <[email protected]>
  • Loading branch information
gix-bot and gix-bot authored Jan 3, 2024
1 parent 90ee40a commit f3d16ff
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 22 deletions.
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.73.0"
channel = "1.75.0"
targets = ["wasm32-unknown-unknown"]
20 changes: 10 additions & 10 deletions src/archive/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fn should_keep_entries_across_upgrades() -> Result<(), CallError> {

let logs = api::get_entries(&env, canister_id, None, None)?;
assert_eq!(logs.entries.len(), 1);
assert_eq!(logs.entries.get(0).unwrap().as_ref().unwrap(), &entry);
assert_eq!(logs.entries.first().unwrap().as_ref().unwrap(), &entry);
let user_logs = api::get_anchor_entries(&env, canister_id, ANCHOR_NUMBER_1, None, None)?;
assert_eq!(user_logs.entries.len(), 1);
Ok(())
Expand Down Expand Up @@ -84,7 +84,7 @@ mod rollback_tests {
let logs = api::get_entries(&env, canister_id, None, None)?;
assert_eq!(logs.entries.len(), 1);
assert_eq!(
CompatEntry::from(logs.entries.get(0).unwrap().clone().unwrap()),
CompatEntry::from(logs.entries.first().unwrap().clone().unwrap()),
entry
);
Ok(())
Expand Down Expand Up @@ -121,7 +121,7 @@ mod rollback_tests {
let logs = api::get_entries(&env, canister_id, None, None)?;
assert_eq!(logs.entries.len(), 2);
assert_eq!(
CompatEntry::from(logs.entries.get(0).unwrap().clone().unwrap()),
CompatEntry::from(logs.entries.first().unwrap().clone().unwrap()),
entry1
);
assert_eq!(
Expand Down Expand Up @@ -216,7 +216,7 @@ mod read_tests {
let logs = api::get_entries(&env, canister_id, None, None)?;
assert_eq!(logs.entries.len(), 1);
assert_eq!(
logs.entries.get(0).unwrap().as_ref().unwrap(),
logs.entries.first().unwrap().as_ref().unwrap(),
&log_entry_1()
);
Ok(())
Expand Down Expand Up @@ -251,14 +251,14 @@ mod read_tests {
let user_1_logs = api::get_anchor_entries(&env, canister_id, ANCHOR_NUMBER_1, None, None)?;
assert_eq!(user_1_logs.entries.len(), 1);
assert_eq!(
user_1_logs.entries.get(0).unwrap().as_ref().unwrap(),
user_1_logs.entries.first().unwrap().as_ref().unwrap(),
&log_entry_1()
);

let user_2_logs = api::get_anchor_entries(&env, canister_id, ANCHOR_NUMBER_2, None, None)?;
assert_eq!(user_2_logs.entries.len(), 1);
assert_eq!(
user_2_logs.entries.get(0).unwrap().as_ref().unwrap(),
user_2_logs.entries.first().unwrap().as_ref().unwrap(),
&log_entry_2()
);

Expand Down Expand Up @@ -319,7 +319,7 @@ mod read_tests {
assert_eq!(logs.entries.len(), 2);
assert_eq!(
logs.entries
.get(0)
.first()
.unwrap()
.as_ref()
.unwrap()
Expand Down Expand Up @@ -404,7 +404,7 @@ mod read_tests {
)?;
assert_eq!(logs.entries.len(), 2);
assert_eq!(
logs.entries.get(0).unwrap().as_ref().unwrap(),
logs.entries.first().unwrap().as_ref().unwrap(),
&log_entry_2()
);
assert_eq!(
Expand Down Expand Up @@ -449,7 +449,7 @@ mod read_tests {

let logs = api::get_anchor_entries(&env, canister_id, ANCHOR_NUMBER_1, None, None)?;
assert_eq!(logs.entries.len(), 3);
assert_eq!(logs.entries.get(0).unwrap().as_ref().unwrap().timestamp, 1);
assert_eq!(logs.entries.first().unwrap().as_ref().unwrap().timestamp, 1);
assert_eq!(
logs.entries.get(1).unwrap().as_ref().unwrap().timestamp,
1u64 << 8
Expand Down Expand Up @@ -749,7 +749,7 @@ mod stable_memory_tests {
sequence_number: 0,
};
assert_eq!(
entries.entries.get(0).unwrap().as_ref().unwrap(),
entries.entries.first().unwrap().as_ref().unwrap(),
&register_entry
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ mod pull_entries_tests {
sequence_number: 0,
};
assert_eq!(
entries.entries.get(0).unwrap().as_ref().unwrap(),
entries.entries.first().unwrap().as_ref().unwrap(),
&register_entry
);

Expand Down Expand Up @@ -375,7 +375,7 @@ mod pull_entries_tests {
sequence_number: 0,
};
assert_eq!(
entries.entries.get(0).unwrap().as_ref().unwrap(),
entries.entries.first().unwrap().as_ref().unwrap(),
&expected_register_entry
);

Expand Down Expand Up @@ -506,7 +506,7 @@ mod pull_entries_tests {
sequence_number: 0,
};
assert_eq!(
entries.entries.get(0).unwrap().as_ref().unwrap(),
entries.entries.first().unwrap().as_ref().unwrap(),
&expected_metadata_entry
);

Expand Down Expand Up @@ -715,7 +715,7 @@ mod pull_entries_tests {
message: format!("Canister {} is stopped", ii_canister.to_text()),
};
assert_eq!(
status.call_info.call_errors.get(0).unwrap(),
status.call_info.call_errors.first().unwrap(),
&expected_error
);
Ok(())
Expand Down
10 changes: 3 additions & 7 deletions src/vc_util/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,9 @@ pub fn verify_ii_presentation_jwt_with_canister_ids(
"expected exactly two verifiable credentials".to_string(),
));
}
let id_alias_vc_jws =
presentation
.verifiable_credential
.get(0)
.ok_or(PresentationVerificationError::Unknown(
"missing id_alias vc".to_string(),
))?;
let id_alias_vc_jws = presentation.verifiable_credential.first().ok_or(
PresentationVerificationError::Unknown("missing id_alias vc".to_string()),
)?;
let alias_tuple = get_verified_id_alias_from_jws(
id_alias_vc_jws.as_str(),
&vc_flow_signers.ii_canister_id,
Expand Down

0 comments on commit f3d16ff

Please sign in to comment.