Skip to content

Commit

Permalink
got rid of already invalid test
Browse files Browse the repository at this point in the history
  • Loading branch information
supreme committed Mar 3, 2024
1 parent 53ccad9 commit 0df43a1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 45 deletions.
44 changes: 0 additions & 44 deletions pallets/subspace/tests/burn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,47 +120,3 @@ fn test_burn() {
});
}

#[test]
fn test_min_burn() {
new_test_ext().execute_with(|| {
let netuid = 0;
let n = 10;

let initial_stake: u64 = 1000;

let keys: Vec<U256> = (0..n).map(U256::from).collect();
let stakes: Vec<u64> = (0..n).map(|_x| initial_stake * 1_000_000_000).collect();

// founder register_module(netuid, keys[i]);
let founder_initial_stake = stakes[0];
assert_ok!(register_module(netuid, keys[0], stakes[0]));
let founder_current_stake = SubspaceModule::get_total_stake_to(netuid, &keys[0]);
assert_eq!(
founder_initial_stake, founder_current_stake,
"founder_initial_stake: {:?} founder_current_stake: {:?}",
founder_initial_stake, founder_current_stake
);

// set the burn min to 1000000000
// register_module(netuid, keys[i]);
let mut params = SubspaceModule::global_params();
params.min_burn = 100;
SubspaceModule::set_global_params(params.clone());
params = SubspaceModule::global_params();
for i in 1..n {
assert_ok!(register_module(netuid, keys[i], stakes[i]));
println!("params: {:?}", params);

let key_stake_after = SubspaceModule::get_total_stake_to(netuid, &keys[i]);
assert_eq!(
key_stake_after,
stakes[i] - params.min_burn,
"key_stake_after: {:?} stakes[i]: {:?}",
key_stake_after,
stakes[i]
);
}

let _voter_key = keys[1];
});
}
2 changes: 1 addition & 1 deletion pallets/subspace/tests/registration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ fn test_delegate_register() {
let stake_amount: u64 = 10_000_000_000;
SubspaceModule::add_balance_to_account(&key, stake_amount * n as u64);
for module_key in module_keys {
delegate_register_module(netuid, key, module_key, stake_amount);
let _ = delegate_register_module(netuid, key, module_key, stake_amount);
let key_balance = SubspaceModule::get_balance_u64(&key);
let stake_to_module = SubspaceModule::get_stake_to_module(netuid, &key, &module_key);
println!("key_balance: {:?}", key_balance);
Expand Down

0 comments on commit 0df43a1

Please sign in to comment.