@@ -32,7 +32,6 @@ fn test_replace_neuron() {
3232
3333 let new_hotkey_account_id = U256 :: from ( 2 ) ;
3434 let _new_colkey_account_id = U256 :: from ( 12345 ) ;
35- let certificate = NeuronCertificate :: try_from ( vec ! [ 1 , 2 , 3 ] ) . unwrap ( ) ;
3635 let evm_address = H160 :: from_slice ( & [ 1_u8 ; 20 ] ) ;
3736 //add network
3837 add_network ( netuid, tempo, 0 ) ;
@@ -71,28 +70,11 @@ fn test_replace_neuron() {
7170 } ) ;
7271 Bonds :: < Test > :: insert ( NetUidStorageIndex :: from ( netuid) , neuron_uid, vec ! [ ( 0 , 1 ) ] ) ;
7372
74- // serve axon mock address
75- let ip: u128 = 1676056785 ;
76- let port: u16 = 9999 ;
77- let ip_type: u8 = 4 ;
78- assert ! (
79- SubtensorModule :: serve_axon(
80- <<Test as Config >:: RuntimeOrigin >:: signed( hotkey_account_id) ,
81- netuid,
82- 0 ,
83- ip,
84- port,
85- ip_type,
86- 0 ,
87- 0 ,
88- 0
89- )
90- . is_ok( )
91- ) ;
92-
93- // Set a neuron certificate for it
94- NeuronCertificates :: < Test > :: insert ( netuid, hotkey_account_id, certificate) ;
73+ Axons :: < Test > :: insert ( netuid, hotkey_account_id, AxonInfoOf :: default ( ) ) ;
74+ NeuronCertificates :: < Test > :: insert ( netuid, hotkey_account_id, NeuronCertificateOf :: default ( ) ) ;
75+ Prometheus :: < Test > :: insert ( netuid, hotkey_account_id, PrometheusInfoOf :: default ( ) ) ;
9576 AssociatedEvmAddress :: < Test > :: insert ( netuid, neuron_uid, ( evm_address, 1 ) ) ;
77+
9678 // Replace the neuron.
9779 SubtensorModule :: replace_neuron ( netuid, neuron_uid, & new_hotkey_account_id, block_number) ;
9880
@@ -139,10 +121,9 @@ fn test_replace_neuron() {
139121 ) ;
140122
141123 // Check axon info is reset.
142- let axon_info = SubtensorModule :: get_axon_info ( netuid, & curr_hotkey. unwrap ( ) ) ;
143- assert_eq ! ( axon_info. ip, 0 ) ;
144- assert_eq ! ( axon_info. port, 0 ) ;
145- assert_eq ! ( axon_info. ip_type, 0 ) ;
124+ assert ! ( !Axons :: <Test >:: contains_key( netuid, curr_hotkey. unwrap( ) ) ) ;
125+ assert ! ( !NeuronCertificates :: <Test >:: contains_key( netuid, curr_hotkey. unwrap( ) ) ) ;
126+ assert ! ( !Prometheus :: <Test >:: contains_key( netuid, curr_hotkey. unwrap( ) ) ) ;
146127
147128 // Check bonds are cleared.
148129 assert_eq ! (
0 commit comments