@@ -3,7 +3,7 @@ use frame_support::traits::Currency;
33use crate :: mock:: * ;
44use frame_support:: dispatch:: { DispatchClass , DispatchInfo , GetDispatchInfo , Pays } ;
55use frame_support:: sp_runtime:: { transaction_validity:: InvalidTransaction , DispatchError } ;
6- use frame_support:: { assert_err, assert_ok} ;
6+ use frame_support:: { assert_err, assert_noop , assert_ok} ;
77use frame_system:: Config ;
88use pallet_subtensor:: { AxonInfoOf , Error , SubtensorSignedExtension } ;
99use sp_core:: U256 ;
@@ -382,6 +382,33 @@ fn test_burned_registration_ok() {
382382 } ) ;
383383}
384384
385+ #[ test]
386+ fn test_burn_registration_without_neuron_slot ( ) {
387+ new_test_ext ( 1 ) . execute_with ( || {
388+ let netuid: u16 = 1 ;
389+ let tempo: u16 = 13 ;
390+ let hotkey_account_id = U256 :: from ( 1 ) ;
391+ let burn_cost = 1000 ;
392+ let coldkey_account_id = U256 :: from ( 667 ) ; // Neighbour of the beast, har har
393+ //add network
394+ SubtensorModule :: set_burn ( netuid, burn_cost) ;
395+ add_network ( netuid, tempo, 0 ) ;
396+ // Give it some $$$ in his coldkey balance
397+ SubtensorModule :: add_balance_to_coldkey_account ( & coldkey_account_id, 10000 ) ;
398+ SubtensorModule :: set_max_allowed_uids ( netuid, 0 ) ;
399+
400+ // Subscribe and check extrinsic output
401+ assert_noop ! (
402+ SubtensorModule :: burned_register(
403+ <<Test as Config >:: RuntimeOrigin >:: signed( coldkey_account_id) ,
404+ netuid,
405+ hotkey_account_id
406+ ) ,
407+ Error :: <Test >:: NoNeuronIdAvailable
408+ ) ;
409+ } ) ;
410+ }
411+
385412#[ test]
386413fn test_burn_adjustment ( ) {
387414 new_test_ext ( 1 ) . execute_with ( || {
0 commit comments