Skip to content

Commit c6bcbbd

Browse files
authored
Merge pull request #2330 from opentensor/fix/subnet-registration-disable-user-liquidity
Fix/Don't Enable User Liquidity on Subnet Reg
2 parents d65dbae + 0d92984 commit c6bcbbd

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

pallets/subtensor/src/macros/dispatches.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,7 @@ mod dispatches {
12311231
#[pallet::call_index(59)]
12321232
#[pallet::weight((Weight::from_parts(235_400_000, 0)
12331233
.saturating_add(T::DbWeight::get().reads(36_u64))
1234-
.saturating_add(T::DbWeight::get().writes(53_u64)), DispatchClass::Normal, Pays::Yes))]
1234+
.saturating_add(T::DbWeight::get().writes(52_u64)), DispatchClass::Normal, Pays::Yes))]
12351235
pub fn register_network(origin: OriginFor<T>, hotkey: T::AccountId) -> DispatchResult {
12361236
Self::do_register_network(origin, &hotkey, 1, None)
12371237
}
@@ -1519,7 +1519,7 @@ mod dispatches {
15191519
#[pallet::call_index(79)]
15201520
#[pallet::weight((Weight::from_parts(234_200_000, 0)
15211521
.saturating_add(T::DbWeight::get().reads(35_u64))
1522-
.saturating_add(T::DbWeight::get().writes(52_u64)), DispatchClass::Normal, Pays::Yes))]
1522+
.saturating_add(T::DbWeight::get().writes(51_u64)), DispatchClass::Normal, Pays::Yes))]
15231523
pub fn register_network_with_identity(
15241524
origin: OriginFor<T>,
15251525
hotkey: T::AccountId,

pallets/subtensor/src/subnets/subnet.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use super::*;
22
use sp_core::Get;
33
use subtensor_runtime_common::{NetUid, TaoCurrency};
4-
use subtensor_swap_interface::SwapHandler;
54
impl<T: Config> Pallet<T> {
65
/// Returns true if the subnetwork exists.
76
///
@@ -247,7 +246,6 @@ impl<T: Config> Pallet<T> {
247246
Self::deposit_event(Event::SubnetIdentitySet(netuid_to_register));
248247
}
249248

250-
T::SwapInterface::toggle_user_liquidity(netuid_to_register, true);
251249
// --- 18. Emit the NetworkAdded event.
252250
log::info!("NetworkAdded( netuid:{netuid_to_register:?}, mechanism:{mechid:?} )");
253251
Self::deposit_event(Event::NetworkAdded(netuid_to_register, mechid));

pallets/subtensor/src/tests/networks.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1820,6 +1820,7 @@ fn massive_dissolve_refund_and_reregistration_flow_is_lossless_and_cleans_state(
18201820
let ct = pallet_subtensor_swap::CurrentTick::<Test>::get(net);
18211821
let lo = ct.saturating_sub(band);
18221822
let hi = ct.saturating_add(band);
1823+
pallet_subtensor_swap::EnabledUserLiquidity::<Test>::insert(net, true);
18231824
assert_ok!(pallet_subtensor_swap::Pallet::<Test>::add_liquidity(
18241825
RuntimeOrigin::signed(cold),
18251826
hot,

0 commit comments

Comments
 (0)