@@ -1013,9 +1013,7 @@ fn test_dissolve_network_unstake_nominators_ok() {
1013
1013
1014
1014
// Check that the balance was correctly updated and the stake was removed
1015
1015
assert_eq ! ( new_balance, initial_balance + stake) ;
1016
- assert ! ( !<pallet_subtensor:: Stake <Test >>:: contains_key(
1017
- hotkey, coldkey
1018
- ) ) ;
1016
+ assert_eq ! ( <pallet_subtensor:: Stake <Test >>:: get( hotkey, coldkey) , 0 ) ;
1019
1017
} ) ;
1020
1018
}
1021
1019
@@ -1061,9 +1059,7 @@ fn test_dissolve_network_unstake_delegate_ok() {
1061
1059
1062
1060
// Check that the delegate's balance was correctly updated and the stake was removed
1063
1061
assert_eq ! ( new_delegate_balance, initial_delegate_balance + stake) ;
1064
- assert ! ( !<pallet_subtensor:: Stake <Test >>:: contains_key(
1065
- hotkey, coldkey
1066
- ) ) ;
1062
+ assert_eq ! ( <pallet_subtensor:: Stake <Test >>:: get( hotkey, coldkey) , 0 ) ;
1067
1063
} ) ;
1068
1064
}
1069
1065
@@ -1107,12 +1103,11 @@ fn test_dissolve_network_unstake_nominators_and_delegates_partial_match() {
1107
1103
// Check that only the second network's stake was removed and balance updated
1108
1104
assert_eq ! ( new_balance1, initial_balance1) ;
1109
1105
assert_eq ! ( new_balance2, initial_balance2 + stake2) ; // Only change for hotkey2
1110
- assert ! ( <pallet_subtensor:: Stake <Test >>:: contains_key(
1111
- hotkey1, coldkey1
1112
- ) ) ;
1113
- assert ! ( !<pallet_subtensor:: Stake <Test >>:: contains_key(
1114
- hotkey2, coldkey2
1115
- ) ) ;
1106
+ assert_eq ! (
1107
+ <pallet_subtensor:: Stake <Test >>:: get( hotkey1, coldkey1) ,
1108
+ stake1
1109
+ ) ;
1110
+ assert_eq ! ( <pallet_subtensor:: Stake <Test >>:: get( hotkey2, coldkey2) , 0 ) ;
1116
1111
} ) ;
1117
1112
}
1118
1113
@@ -1150,12 +1145,8 @@ fn test_dissolve_network_unstake_multiple_stakes_same_hotkey() {
1150
1145
// Check that both stakes were removed and the balances updated
1151
1146
assert_eq ! ( new_balance1, initial_balance1 + stake1) ;
1152
1147
assert_eq ! ( new_balance2, initial_balance2 + stake2) ;
1153
- assert ! ( !<pallet_subtensor:: Stake <Test >>:: contains_key(
1154
- hotkey, coldkey1
1155
- ) ) ;
1156
- assert ! ( !<pallet_subtensor:: Stake <Test >>:: contains_key(
1157
- hotkey, coldkey2
1158
- ) ) ;
1148
+ assert_eq ! ( <pallet_subtensor:: Stake <Test >>:: get( hotkey, coldkey1) , 0 ) ;
1149
+ assert_eq ! ( <pallet_subtensor:: Stake <Test >>:: get( hotkey, coldkey2) , 0 ) ;
1159
1150
} ) ;
1160
1151
}
1161
1152
@@ -1291,10 +1282,7 @@ fn test_dissolve_network_complex_state() {
1291
1282
) ;
1292
1283
1293
1284
assert_eq ! ( new_balance, stake + initial_balances[ i] ) ;
1294
-
1295
- assert ! ( !<pallet_subtensor:: Stake <Test >>:: contains_key(
1296
- hotkey, coldkey
1297
- ) ) ;
1285
+ assert_eq ! ( <pallet_subtensor:: Stake <Test >>:: get( hotkey, coldkey) , 0 ) ;
1298
1286
}
1299
1287
} ) ;
1300
1288
}
0 commit comments