diff --git a/pallets/subtensor/src/tests/staking.rs b/pallets/subtensor/src/tests/staking.rs index bca9ce046..46d562a25 100644 --- a/pallets/subtensor/src/tests/staking.rs +++ b/pallets/subtensor/src/tests/staking.rs @@ -169,34 +169,23 @@ fn test_add_stake_not_registered_key_pair() { } #[test] -fn test_add_stake_err_neuron_does_not_belong_to_coldkey() { +fn test_add_stake_ok_neuron_does_not_belong_to_coldkey() { new_test_ext(1).execute_with(|| { - assert!(false); - - // let coldkey_id = U256::from(544); - // let hotkey_id = U256::from(54544); - // let other_cold_key = U256::from(99498); - // let netuid: u16 = 1; - // let tempo: u16 = 13; - // let start_nonce: u64 = 0; - - // //add network - // add_network(netuid, tempo, 0); + let coldkey_id = U256::from(544); + let hotkey_id = U256::from(54544); + let other_cold_key = U256::from(99498); + let netuid: u16 = add_dynamic_network(&hotkey_id, &coldkey_id); - // register_ok_neuron(netuid, hotkey_id, coldkey_id, start_nonce); - // // Give it some $$$ in his coldkey balance - // SubtensorModule::add_balance_to_coldkey_account(&other_cold_key, 100000); + // Give it some $$$ in his coldkey balance + SubtensorModule::add_balance_to_coldkey_account(&other_cold_key, 100000); - // // Perform the request which is signed by a different cold key - // let result = SubtensorModule::add_stake( - // <::RuntimeOrigin>::signed(other_cold_key), - // hotkey_id, - // 1000, - // ); - // assert_eq!( - // result, - // Err(Error::::HotKeyNotDelegateAndSignerNotOwnHotKey.into()) - // ); + // Perform the request which is signed by a different cold key + assert_ok!(SubtensorModule::add_stake( + <::RuntimeOrigin>::signed(other_cold_key), + hotkey_id, + netuid, + 1000, + )); }); }