From b7613211aebc60d3282dcffe5d19dd11bcd71dc7 Mon Sep 17 00:00:00 2001 From: Honza <115138297+Supremesource@users.noreply.github.com> Date: Mon, 2 Dec 2024 20:56:33 -0300 Subject: [PATCH] fuck phantom data --- pallets/subnet_emission/src/lib.rs | 2 +- pallets/subspace/src/lib.rs | 30 +++++++++++++++--------------- pallets/subspace/src/macros.rs | 6 +++--- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pallets/subnet_emission/src/lib.rs b/pallets/subnet_emission/src/lib.rs index c7394ef51..14fda5eb7 100644 --- a/pallets/subnet_emission/src/lib.rs +++ b/pallets/subnet_emission/src/lib.rs @@ -134,7 +134,7 @@ pub mod pallet { swap_storages: { optional: { }, required: { - Weights: Vec<(u16, u16)> = |_: PhantomData| Vec::<(u16, u16)>::new(), + Weights: Vec<(u16, u16)> = Vec::<(u16, u16)>::new(), } }, key_storages: { }, diff --git a/pallets/subspace/src/lib.rs b/pallets/subspace/src/lib.rs index 526043710..b4a4fabe3 100644 --- a/pallets/subspace/src/lib.rs +++ b/pallets/subspace/src/lib.rs @@ -152,27 +152,27 @@ pub mod pallet { define_module_includes!( // Put here every module-related storage map that has netuid as a key and holds a vector of values. The vector has to be indexed by the module uid. vectors: { - Active: bool = |_: PhantomData| false, - Consensus: u64 = |_: PhantomData| 0, - Emission: u64 = |_: PhantomData| 0, - Incentive: u64 = |_: PhantomData| 0, - Dividends: u64 = |_: PhantomData| 0, - LastUpdate: u64 = |_: PhantomData| Pallet::::get_current_block_number(), - Rank: u64 = |_: PhantomData| 0, - Trust: u64 = |_: PhantomData| 0, - ValidatorPermits: bool = |_: PhantomData| false, - ValidatorTrust: u64 = |_: PhantomData| 0, - PruningScores: u16 = |_: PhantomData| 0, + Active: bool = false, + Consensus: u64 = 0, + Emission: u64 = 0, + Incentive: u64 = 0, + Dividends: u64 = 0, + LastUpdate: u64 = Pallet::::get_current_block_number(), + Rank: u64 = 0, + Trust: u64 = 0, + ValidatorPermits: bool = false, + ValidatorTrust: u64 = 0, + PruningScores: u16 = 0, }, // Put here every module-related double map, where the first key is netuid, second key is module uid. These storages holds some value for each module ie. name, address, etc. swap_storages: { optional: { }, required: { - RegistrationBlock: u64 = |_: PhantomData| Pallet::::get_current_block_number(), - Address: Vec = |_: PhantomData| Vec::::new(), - Name: Vec = |_: PhantomData| Vec::::new(), - Bonds: Vec<(u16, u16)> = |_: PhantomData| Vec::<(u16, u16)>::new(), + RegistrationBlock: u64 = Pallet::::get_current_block_number(), + Address: Vec = Vec::::new(), + Name: Vec = Vec::::new(), + Bonds: Vec<(u16, u16)> = Vec::<(u16, u16)>::new(), } }, // Specifically for uids and keys diff --git a/pallets/subspace/src/macros.rs b/pallets/subspace/src/macros.rs index 8a2c6b43e..6b5463b84 100644 --- a/pallets/subspace/src/macros.rs +++ b/pallets/subspace/src/macros.rs @@ -191,7 +191,7 @@ macro_rules! define_module_includes { Self::$vec => { let mut vec = $vec::::get(netuid); $( - vec.push($vec_default(PhantomData::)); + vec.push($vec_default); )? $vec::::insert(netuid, vec); Ok(()) @@ -242,13 +242,13 @@ macro_rules! define_module_includes { match self { $( Self::$opt_swap => { - $($opt_swap::::insert(netuid, uid, $opt_default(PhantomData::));)? + $($opt_swap::::insert(netuid, uid, $opt_default);)? Ok(()) }, )* $( Self::$req_swap => { - $($req_swap::::insert(netuid, uid, $req_default(PhantomData::));)? + $($req_swap::::insert(netuid, uid, $req_default);)? Ok(()) }, )*