@@ -189,10 +189,10 @@ pub mod pallet {
189
189
pub ip_type : u8 ,
190
190
}
191
191
192
- /// Struct for ChainIdentities.
192
+ /// Struct for ChainIdentities. (DEPRECATED for V2)
193
193
pub type ChainIdentityOf = ChainIdentity ;
194
194
195
- /// Data structure for Chain Identities.
195
+ /// Data structure for Chain Identities. (DEPRECATED for V2)
196
196
#[ crate :: freeze_struct( "bbfd00438dbe2b58" ) ]
197
197
#[ derive( Encode , Decode , Default , TypeInfo , Clone , PartialEq , Eq , Debug ) ]
198
198
pub struct ChainIdentity {
@@ -210,9 +210,32 @@ pub mod pallet {
210
210
pub additional : Vec < u8 > ,
211
211
}
212
212
213
- /// Struct for SubnetIdentities.
213
+ /// Struct for ChainIdentities.
214
+ pub type ChainIdentityOfV2 = ChainIdentityV2 ;
215
+
216
+ /// Data structure for Chain Identities.
217
+ #[ crate :: freeze_struct( "ad72a270be7b59d7" ) ]
218
+ #[ derive( Encode , Decode , Default , TypeInfo , Clone , PartialEq , Eq , Debug ) ]
219
+ pub struct ChainIdentityV2 {
220
+ /// The name of the chain identity
221
+ pub name : Vec < u8 > ,
222
+ /// The URL associated with the chain identity
223
+ pub url : Vec < u8 > ,
224
+ /// The github repository associated with the identity
225
+ pub github_repo : Vec < u8 > ,
226
+ /// The image representation of the chain identity
227
+ pub image : Vec < u8 > ,
228
+ /// The Discord information for the chain identity
229
+ pub discord : Vec < u8 > ,
230
+ /// A description of the chain identity
231
+ pub description : Vec < u8 > ,
232
+ /// Additional information about the chain identity
233
+ pub additional : Vec < u8 > ,
234
+ }
235
+
236
+ /// Struct for SubnetIdentities. (DEPRECATED for V2)
214
237
pub type SubnetIdentityOf = SubnetIdentity ;
215
- /// Data structure for Subnet Identities
238
+ /// Data structure for Subnet Identities. (DEPRECATED for V2)
216
239
#[ crate :: freeze_struct( "f448dc3dad763108" ) ]
217
240
#[ derive( Encode , Decode , Default , TypeInfo , Clone , PartialEq , Eq , Debug ) ]
218
241
pub struct SubnetIdentity {
@@ -223,6 +246,28 @@ pub mod pallet {
223
246
/// The subnet's contact
224
247
pub subnet_contact : Vec < u8 > ,
225
248
}
249
+
250
+ /// Struct for SubnetIdentitiesV2.
251
+ pub type SubnetIdentityOfV2 = SubnetIdentityV2 ;
252
+ /// Data structure for Subnet Identities
253
+ #[ crate :: freeze_struct( "e002be4cd05d7b3e" ) ]
254
+ #[ derive( Encode , Decode , Default , TypeInfo , Clone , PartialEq , Eq , Debug ) ]
255
+ pub struct SubnetIdentityV2 {
256
+ /// The name of the subnet
257
+ pub subnet_name : Vec < u8 > ,
258
+ /// The github repository associated with the subnet
259
+ pub github_repo : Vec < u8 > ,
260
+ /// The subnet's contact
261
+ pub subnet_contact : Vec < u8 > ,
262
+ /// The subnet's website
263
+ pub subnet_url : Vec < u8 > ,
264
+ /// The subnet's discord
265
+ pub discord : Vec < u8 > ,
266
+ /// The subnet's description
267
+ pub description : Vec < u8 > ,
268
+ /// Additional information about the subnet
269
+ pub additional : Vec < u8 > ,
270
+ }
226
271
/// ============================
227
272
/// ==== Staking + Accounts ====
228
273
/// ============================
@@ -703,7 +748,7 @@ pub mod pallet {
703
748
#[ pallet:: type_value]
704
749
/// Default value for applying pending items (e.g. childkeys).
705
750
pub fn DefaultPendingCooldown < T : Config > ( ) -> u64 {
706
- 7200
751
+ 1
707
752
}
708
753
709
754
#[ pallet:: type_value]
@@ -717,7 +762,7 @@ pub mod pallet {
717
762
/// Default staking fee.
718
763
/// 500k rao matches $0.25 at $500/TAO
719
764
pub fn DefaultStakingFee < T : Config > ( ) -> u64 {
720
- 500_000
765
+ 50_000
721
766
}
722
767
723
768
#[ pallet:: type_value]
@@ -732,6 +777,18 @@ pub mod pallet {
732
777
T :: InitialDissolveNetworkScheduleDuration :: get ( )
733
778
}
734
779
780
+ #[ pallet:: type_value]
781
+ /// Default moving alpha for the moving price.
782
+ pub fn DefaultMovingAlpha < T : Config > ( ) -> I96F32 {
783
+ // Moving average take 30 days to reach 50% of the price
784
+ // and 3.5 months to reach 90%.
785
+ I96F32 :: saturating_from_num ( 0.000003 )
786
+ }
787
+ #[ pallet:: type_value]
788
+ /// Default subnet moving price.
789
+ pub fn DefaultMovingPrice < T : Config > ( ) -> I96F32 {
790
+ I96F32 :: saturating_from_num ( 0.0 )
791
+ }
735
792
#[ pallet:: type_value]
736
793
/// Default value for Share Pool variables
737
794
pub fn DefaultSharePoolZero < T : Config > ( ) -> U64F64 {
@@ -910,6 +967,11 @@ pub mod pallet {
910
967
pub type TotalStake < T > = StorageValue < _ , u64 , ValueQuery > ;
911
968
#[ pallet:: storage] // --- ITEM ( dynamic_block ) -- block when dynamic was turned on.
912
969
pub type DynamicBlock < T > = StorageValue < _ , u64 , ValueQuery > ;
970
+ #[ pallet:: storage] // --- ITEM ( moving_alpha ) -- subnet moving alpha.
971
+ pub type SubnetMovingAlpha < T > = StorageValue < _ , I96F32 , ValueQuery , DefaultMovingAlpha < T > > ;
972
+ #[ pallet:: storage] // --- MAP ( netuid ) --> moving_price | The subnet moving price.
973
+ pub type SubnetMovingPrice < T : Config > =
974
+ StorageMap < _ , Identity , u16 , I96F32 , ValueQuery , DefaultMovingPrice < T > > ;
913
975
#[ pallet:: storage] // --- MAP ( netuid ) --> total_volume | The total amount of TAO bought and sold since the start of the network.
914
976
pub type SubnetVolume < T : Config > =
915
977
StorageMap < _ , Identity , u16 , u128 , ValueQuery , DefaultZeroU128 < T > > ;
@@ -1409,14 +1471,22 @@ pub mod pallet {
1409
1471
PrometheusInfoOf ,
1410
1472
OptionQuery ,
1411
1473
> ;
1412
- #[ pallet:: storage] // --- MAP ( coldkey ) --> identity
1474
+ #[ pallet:: storage] // --- MAP ( coldkey ) --> identity. (DEPRECATED for V2)
1413
1475
pub type Identities < T : Config > =
1414
1476
StorageMap < _ , Blake2_128Concat , T :: AccountId , ChainIdentityOf , OptionQuery > ;
1415
1477
1416
- #[ pallet:: storage] // --- MAP ( netuid ) --> identity
1478
+ #[ pallet:: storage] // --- MAP ( coldkey ) --> identity
1479
+ pub type IdentitiesV2 < T : Config > =
1480
+ StorageMap < _ , Blake2_128Concat , T :: AccountId , ChainIdentityOfV2 , OptionQuery > ;
1481
+
1482
+ #[ pallet:: storage] // --- MAP ( netuid ) --> identity. (DEPRECATED for V2)
1417
1483
pub type SubnetIdentities < T : Config > =
1418
1484
StorageMap < _ , Blake2_128Concat , u16 , SubnetIdentityOf , OptionQuery > ;
1419
1485
1486
+ #[ pallet:: storage] // --- MAP ( netuid ) --> identityV2
1487
+ pub type SubnetIdentitiesV2 < T : Config > =
1488
+ StorageMap < _ , Blake2_128Concat , u16 , SubnetIdentityOfV2 , OptionQuery > ;
1489
+
1420
1490
/// =================================
1421
1491
/// ==== Axon / Promo Endpoints =====
1422
1492
/// =================================
0 commit comments