diff --git a/crates/sui-cluster-test/src/test_case/coin_index_test.rs b/crates/sui-cluster-test/src/test_case/coin_index_test.rs index a87caa627bd45..7aea7b733e28a 100644 --- a/crates/sui-cluster-test/src/test_case/coin_index_test.rs +++ b/crates/sui-cluster-test/src/test_case/coin_index_test.rs @@ -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(), @@ -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,);