@@ -352,118 +352,6 @@ mod dispatches {
352
352
)
353
353
}
354
354
355
- /// # Args:
356
- /// * `origin`: (<T as frame_system::Config>Origin):
357
- /// - The caller, a hotkey who wishes to set their weights.
358
- ///
359
- /// * `netuid` (u16):
360
- /// - The network uid we are setting these weights on.
361
- ///
362
- /// * `hotkey` (T::AccountId):
363
- /// - The hotkey associated with the operation and the calling coldkey.
364
- ///
365
- /// * `dests` (Vec<u16>):
366
- /// - The edge endpoint for the weight, i.e. j for w_ij.
367
- ///
368
- /// * 'weights' (Vec<u16>):
369
- /// - The u16 integer encoded weights. Interpreted as rational
370
- /// values in the range [0,1]. They must sum to in32::MAX.
371
- ///
372
- /// * 'version_key' ( u64 ):
373
- /// - The network version key to check if the validator is up to date.
374
- ///
375
- /// # Event:
376
- ///
377
- /// * WeightsSet;
378
- /// - On successfully setting the weights on chain.
379
- ///
380
- /// # Raises:
381
- ///
382
- /// * NonAssociatedColdKey;
383
- /// - Attempting to set weights on a non-associated cold key.
384
- ///
385
- /// * 'SubNetworkDoesNotExist':
386
- /// - Attempting to set weights on a non-existent network.
387
- ///
388
- /// * 'NotRootSubnet':
389
- /// - Attempting to set weights on a subnet that is not the root network.
390
- ///
391
- /// * 'WeightVecNotEqualSize':
392
- /// - Attempting to set weights with uids not of same length.
393
- ///
394
- /// * 'UidVecContainInvalidOne':
395
- /// - Attempting to set weights with invalid uids.
396
- ///
397
- /// * 'NotRegistered':
398
- /// - Attempting to set weights from a non registered account.
399
- ///
400
- /// * 'WeightVecLengthIsLow':
401
- /// - Attempting to set weights with fewer weights than min.
402
- ///
403
- /// * 'IncorrectWeightVersionKey':
404
- /// - Attempting to set weights with the incorrect network version key.
405
- ///
406
- /// * 'SettingWeightsTooFast':
407
- /// - Attempting to set weights too fast.
408
- ///
409
- /// * 'WeightVecLengthIsLow':
410
- /// - Attempting to set weights with fewer weights than min.
411
- ///
412
- /// * 'MaxWeightExceeded':
413
- /// - Attempting to set weights with max value exceeding limit.
414
- ///
415
- #[ pallet:: call_index( 8 ) ]
416
- #[ pallet:: weight( ( Weight :: from_parts( 3_176_000 , 0 )
417
- . saturating_add( T :: DbWeight :: get( ) . reads( 0_u64 ) )
418
- . saturating_add( T :: DbWeight :: get( ) . writes( 0_u64 ) ) , DispatchClass :: Normal , Pays :: No ) ) ]
419
- pub fn set_tao_weights (
420
- _origin : OriginFor < T > ,
421
- _netuid : NetUid ,
422
- _hotkey : T :: AccountId ,
423
- _dests : Vec < u16 > ,
424
- _weights : Vec < u16 > ,
425
- _version_key : u64 ,
426
- ) -> DispatchResult {
427
- // DEPRECATED
428
- // Self::do_set_root_weights(origin, netuid, hotkey, dests, weights, version_key)
429
- // Self::do_set_tao_weights(origin, netuid, hotkey, dests, weights, version_key)
430
- Ok ( ( ) )
431
- }
432
-
433
- /// --- Sets the key as a delegate.
434
- ///
435
- /// # Args:
436
- /// * 'origin': (<T as frame_system::Config>Origin):
437
- /// - The signature of the caller's coldkey.
438
- ///
439
- /// * 'hotkey' (T::AccountId):
440
- /// - The hotkey we are delegating (must be owned by the coldkey.)
441
- ///
442
- /// * 'take' (u64):
443
- /// - The stake proportion that this hotkey takes from delegations.
444
- ///
445
- /// # Event:
446
- /// * DelegateAdded;
447
- /// - On successfully setting a hotkey as a delegate.
448
- ///
449
- /// # Raises:
450
- /// * 'NotRegistered':
451
- /// - The hotkey we are delegating is not registered on the network.
452
- ///
453
- /// * 'NonAssociatedColdKey':
454
- /// - The hotkey we are delegating is not owned by the calling coldket.
455
- ///
456
- #[ pallet:: call_index( 1 ) ]
457
- #[ pallet:: weight( ( Weight :: from_parts( 3_406_000 , 0 )
458
- . saturating_add( T :: DbWeight :: get( ) . reads( 0 ) )
459
- . saturating_add( T :: DbWeight :: get( ) . writes( 0 ) ) , DispatchClass :: Normal , Pays :: Yes ) ) ]
460
- pub fn become_delegate ( _origin : OriginFor < T > , _hotkey : T :: AccountId ) -> DispatchResult {
461
- // DEPRECATED
462
- // Self::do_become_delegate(origin, hotkey, Self::get_default_delegate_take())
463
-
464
- Ok ( ( ) )
465
- }
466
-
467
355
/// --- Allows delegates to decrease its take value.
468
356
///
469
357
/// # Args:
@@ -1386,64 +1274,6 @@ mod dispatches {
1386
1274
Ok ( ( ) . into ( ) )
1387
1275
}
1388
1276
1389
- /// Schedule the dissolution of a network at a specified block number.
1390
- ///
1391
- /// # Arguments
1392
- ///
1393
- /// * `origin` - The origin of the call, must be signed by the sender.
1394
- /// * `netuid` - The u16 network identifier to be dissolved.
1395
- ///
1396
- /// # Returns
1397
- ///
1398
- /// Returns a `DispatchResultWithPostInfo` indicating success or failure of the operation.
1399
- ///
1400
- /// # Weight
1401
- ///
1402
- /// Weight is calculated based on the number of database reads and writes.
1403
-
1404
- #[ pallet:: call_index( 74 ) ]
1405
- #[ pallet:: weight( ( Weight :: from_parts( 119_000_000 , 0 )
1406
- . saturating_add( T :: DbWeight :: get( ) . reads( 6 ) )
1407
- . saturating_add( T :: DbWeight :: get( ) . writes( 31 ) ) , DispatchClass :: Normal , Pays :: Yes ) ) ]
1408
- pub fn schedule_dissolve_network (
1409
- _origin : OriginFor < T > ,
1410
- _netuid : NetUid ,
1411
- ) -> DispatchResultWithPostInfo {
1412
- Err ( Error :: < T > :: CallDisabled . into ( ) )
1413
-
1414
- // let who = ensure_signed(origin)?;
1415
-
1416
- // let current_block: BlockNumberFor<T> = <frame_system::Pallet<T>>::block_number();
1417
- // let duration: BlockNumberFor<T> = DissolveNetworkScheduleDuration::<T>::get();
1418
- // let when: BlockNumberFor<T> = current_block.saturating_add(duration);
1419
-
1420
- // let call = Call::<T>::dissolve_network {
1421
- // coldkey: who.clone(),
1422
- // netuid,
1423
- // };
1424
-
1425
- // let bound_call = T::Preimages::bound(LocalCallOf::<T>::from(call.clone()))
1426
- // .map_err(|_| Error::<T>::FailedToSchedule)?;
1427
-
1428
- // T::Scheduler::schedule(
1429
- // DispatchTime::At(when),
1430
- // None,
1431
- // 63,
1432
- // frame_system::RawOrigin::Root.into(),
1433
- // bound_call,
1434
- // )
1435
- // .map_err(|_| Error::<T>::FailedToSchedule)?;
1436
-
1437
- // // Emit the SwapScheduled event
1438
- // Self::deposit_event(Event::DissolveNetworkScheduled {
1439
- // account: who.clone(),
1440
- // netuid,
1441
- // execution_block: when,
1442
- // });
1443
-
1444
- // Ok(().into())
1445
- }
1446
-
1447
1277
/// ---- Set prometheus information for the neuron.
1448
1278
/// # Args:
1449
1279
/// * 'origin': (<T as frame_system::Config>Origin):
0 commit comments