Skip to content

Commit

Permalink
[Cluster Test] ensuring both balances are sorted (#11261)
Browse files Browse the repository at this point in the history
## Description 

Adding the same sort to the vectors 

## Test Plan 

CI / Staging runs
---
If your changes are not user-facing and not a breaking change, you can
skip the following section. Otherwise, please indicate what changed, and
then add to the Release Notes section as highlighted during the release
process.

### Type of Change (Check all that apply)

- [ ] user-visible impact
- [ ] breaking change for a client SDKs
- [ ] breaking change for FNs (FN binary must upgrade)
- [ ] breaking change for validators or node operators (must upgrade
binaries)
- [ ] breaking change for on-chain data layout
- [ ] necessitate either a data wipe or data migration

### Release notes
  • Loading branch information
healthydeve authored and ebmifa committed Apr 24, 2023
1 parent 2bc7b17 commit f65b02c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/sui-cluster-test/src/test_case/coin_index_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ impl TestCaseImpl for CoinIndexTest {
10000, // mint amount
);

let balances = client.coin_read_api().get_all_balances(account).await?;
let mut balances = client.coin_read_api().get_all_balances(account).await?;
let mut expected_balances = vec![
Balance {
coin_type: sui_type_str.into(),
Expand All @@ -232,7 +232,8 @@ impl TestCaseImpl for CoinIndexTest {
},
];
// Comes with asc order.
expected_balances.sort_by(|l, r| l.coin_type.cmp(&r.coin_type));
expected_balances.sort_by(|l: &Balance, r| l.coin_type.cmp(&r.coin_type));
balances.sort_by(|l: &Balance, r| l.coin_type.cmp(&r.coin_type));

assert_eq!(balances, expected_balances,);

Expand Down

0 comments on commit f65b02c

Please sign in to comment.