Skip to content

Commit

Permalink
Expect returned accounts to be sorted
Browse files Browse the repository at this point in the history
The runtime API should be deterministic, so the returned lists of
accounts must be sorted.

Co-authored-by: Andreas Fackler <[email protected]>
Signed-off-by: Janito Vaqueiro Ferreira Filho <[email protected]>
  • Loading branch information
jvff and afck authored Nov 28, 2024
1 parent 567b50b commit 14b0638
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions linera-execution/tests/contract_runtime_apis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -598,12 +598,8 @@ async fn test_read_balance_owners_system_api(
application.expect_call(ExpectedCall::execute_operation(
move |runtime, _context, _operation| {
assert_eq!(
runtime
.read_balance_owners()
.unwrap()
.into_iter()
.collect::<HashSet<_>>(),
accounts.keys().copied().collect::<HashSet<_>>()
runtime.read_balance_owners().unwrap(),
accounts.keys().copied().collect::<Vec<_>>()
);
Ok(vec![])
},
Expand Down

0 comments on commit 14b0638

Please sign in to comment.