Skip to content

Commit cdb9f56

Browse files
authored
Merge pull request #1259 from opentensor/nonclaim
Nonclaim
2 parents 812e59b + 4082646 commit cdb9f56

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

pallets/subtensor/src/migrations/migrate_rao.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,14 @@ pub fn migrate_rao<T: Config>() -> Weight {
6161

6262
// Convert subnets and give them lock.
6363
// Set global weight to 18% from the start
64-
TaoWeight::<T>::set(332_041_393_326_771_929);
64+
// Set min lock
65+
NetworkMinLockCost::<T>::set(1_000_000_000);
66+
// Set tao weight.
67+
TaoWeight::<T>::set(3_320_413_933_267_719_290);
6568
for netuid in netuids.iter().clone() {
6669
if *netuid == 0 {
6770
// Give root a single RAO in pool to avoid any catestrophic division by zero.
68-
SubnetAlphaIn::<T>::insert(netuid, 1);
71+
SubnetAlphaIn::<T>::insert(netuid, 1_000_000_000);
6972
SubnetMechanism::<T>::insert(netuid, 0); // Set to zero mechanism.
7073
TokenSymbol::<T>::insert(netuid, Pallet::<T>::get_symbol_for_subnet(0));
7174
continue;

pallets/subtensor/src/tests/migration.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -599,10 +599,10 @@ fn test_migrate_rao() {
599599

600600
// Verify root subnet (netuid 0) state after migration
601601
assert_eq!(SubnetTAO::<Test>::get(netuid_0), 4 * stake_amount); // Root has everything
602-
assert_eq!(SubnetTAO::<Test>::get(netuid_1), lock_amount); // Initial Rao amount.
603-
assert_eq!(SubnetAlphaIn::<Test>::get(netuid_0), 1); // No Alpha in pool on root.
604-
assert_eq!(SubnetAlphaIn::<Test>::get(netuid_1), lock_amount); // Initial Rao amount == num_subnets * lock_amount
605-
assert_eq!(SubnetAlphaOut::<Test>::get(netuid_0), 4 * stake_amount); // All stake is outstanding.
602+
assert_eq!(SubnetTAO::<Test>::get(netuid_1), 1_000_000_000); // Always 1000000000
603+
assert_eq!(SubnetAlphaIn::<Test>::get(netuid_0), 1_000_000_000); // Always 1_000_000_000
604+
assert_eq!(SubnetAlphaIn::<Test>::get(netuid_1), 1_000_000_000); // Always 1_000_000_000
605+
assert_eq!(SubnetAlphaOut::<Test>::get(netuid_0), 4 * stake_amount); // Root has everything.
606606
assert_eq!(SubnetAlphaOut::<Test>::get(netuid_1), 0); // No stake outstanding.
607607

608608
// Assert share information for hotkey1 on netuid_0

0 commit comments

Comments
 (0)