@@ -4,6 +4,7 @@ pub use pallet::*;
44pub mod weights;
55pub use weights:: WeightInfo ;
66
7+ use frame_system:: pallet_prelude:: BlockNumberFor ;
78use sp_runtime:: { traits:: Member , RuntimeAppPublic } ;
89
910mod benchmarking;
@@ -1128,6 +1129,73 @@ pub mod pallet {
11281129
11291130 Ok ( ( ) )
11301131 }
1132+
1133+ /// Sets the duration of the coldkey swap schedule.
1134+ ///
1135+ /// This extrinsic allows the root account to set the duration for the coldkey swap schedule.
1136+ /// The coldkey swap schedule determines how long it takes for a coldkey swap operation to complete.
1137+ ///
1138+ /// # Arguments
1139+ /// * `origin` - The origin of the call, which must be the root account.
1140+ /// * `duration` - The new duration for the coldkey swap schedule, in number of blocks.
1141+ ///
1142+ /// # Errors
1143+ /// * `BadOrigin` - If the caller is not the root account.
1144+ ///
1145+ /// # Weight
1146+ /// Weight is handled by the `#[pallet::weight]` attribute.
1147+ #[ pallet:: call_index( 54 ) ]
1148+ #[ pallet:: weight( ( 0 , DispatchClass :: Operational , Pays :: No ) ) ]
1149+ pub fn sudo_set_coldkey_swap_schedule_duration (
1150+ origin : OriginFor < T > ,
1151+ duration : BlockNumberFor < T > ,
1152+ ) -> DispatchResult {
1153+ // Ensure the call is made by the root account
1154+ ensure_root ( origin) ?;
1155+
1156+ // Set the new duration of schedule coldkey swap
1157+ pallet_subtensor:: Pallet :: < T > :: set_coldkey_swap_schedule_duration ( duration) ;
1158+
1159+ // Log the change
1160+ log:: trace!( "ColdkeySwapScheduleDurationSet( duration: {:?} )" , duration) ;
1161+
1162+ Ok ( ( ) )
1163+ }
1164+
1165+ /// Sets the duration of the dissolve network schedule.
1166+ ///
1167+ /// This extrinsic allows the root account to set the duration for the dissolve network schedule.
1168+ /// The dissolve network schedule determines how long it takes for a network dissolution operation to complete.
1169+ ///
1170+ /// # Arguments
1171+ /// * `origin` - The origin of the call, which must be the root account.
1172+ /// * `duration` - The new duration for the dissolve network schedule, in number of blocks.
1173+ ///
1174+ /// # Errors
1175+ /// * `BadOrigin` - If the caller is not the root account.
1176+ ///
1177+ /// # Weight
1178+ /// Weight is handled by the `#[pallet::weight]` attribute.
1179+ #[ pallet:: call_index( 55 ) ]
1180+ #[ pallet:: weight( ( 0 , DispatchClass :: Operational , Pays :: No ) ) ]
1181+ pub fn sudo_set_dissolve_network_schedule_duration (
1182+ origin : OriginFor < T > ,
1183+ duration : BlockNumberFor < T > ,
1184+ ) -> DispatchResult {
1185+ // Ensure the call is made by the root account
1186+ ensure_root ( origin) ?;
1187+
1188+ // Set the duration of schedule dissolve network
1189+ pallet_subtensor:: Pallet :: < T > :: set_dissolve_network_schedule_duration ( duration) ;
1190+
1191+ // Log the change
1192+ log:: trace!(
1193+ "DissolveNetworkScheduleDurationSet( duration: {:?} )" ,
1194+ duration
1195+ ) ;
1196+
1197+ Ok ( ( ) )
1198+ }
11311199 }
11321200}
11331201
0 commit comments