Skip to content

Commit 8b3c68b

Browse files
committed
typos
1 parent c797cd1 commit 8b3c68b

File tree

11 files changed

+35
-35
lines changed

11 files changed

+35
-35
lines changed

pallets/subtensor/src/coinbase/root.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ impl<T: Config> Pallet<T> {
319319
PendingRootAlphaDivs::<T>::remove(netuid);
320320
PendingOwnerCut::<T>::remove(netuid);
321321
BlocksSinceLastStep::<T>::remove(netuid);
322-
LastMechansimStepBlock::<T>::remove(netuid);
322+
LastMechanismStepBlock::<T>::remove(netuid);
323323
LastAdjustmentBlock::<T>::remove(netuid);
324324

325325
// --- 16. Serving / rho / curves, and other per-net controls.

pallets/subtensor/src/coinbase/run_coinbase.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ impl<T: Config> Pallet<T> {
274274
{
275275
// Restart counters.
276276
BlocksSinceLastStep::<T>::insert(netuid, 0);
277-
LastMechansimStepBlock::<T>::insert(netuid, current_block);
277+
LastMechanismStepBlock::<T>::insert(netuid, current_block);
278278

279279
// Get and drain the subnet pending emission.
280280
let pending_server_alpha = PendingServerEmission::<T>::get(netuid);

pallets/subtensor/src/lib.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ pub mod pallet {
116116
pub const MIN_BALANCE_TO_PERFORM_COLDKEY_SWAP: TaoCurrency = TaoCurrency::new(100_000_000); // 0.1 TAO in RAO
117117

118118
/// Minimum commit reveal periods
119-
pub const MIN_COMMIT_REVEAL_PEROIDS: u64 = 1;
119+
pub const MIN_COMMIT_REVEAL_PERIODS: u64 = 1;
120120
/// Maximum commit reveal periods
121-
pub const MAX_COMMIT_REVEAL_PEROIDS: u64 = 100;
121+
pub const MAX_COMMIT_REVEAL_PERIODS: u64 = 100;
122122

123123
#[pallet::pallet]
124124
#[pallet::without_storage_info]
@@ -594,7 +594,7 @@ pub mod pallet {
594594

595595
/// Default value if network is added.
596596
#[pallet::type_value]
597-
pub fn DefaultNeworksAdded<T: Config>() -> bool {
597+
pub fn DefaultNetworksAdded<T: Config>() -> bool {
598598
false
599599
}
600600

@@ -896,7 +896,7 @@ pub mod pallet {
896896
T::InitialTxDelegateTakeRateLimit::get()
897897
}
898898

899-
/// Default value for chidlkey take rate limiting
899+
/// Default value for childkey take rate limiting
900900
#[pallet::type_value]
901901
pub fn DefaultTxChildKeyTakeRateLimit<T: Config>() -> u64 {
902902
T::InitialTxChildKeyTakeRateLimit::get()
@@ -1533,7 +1533,7 @@ pub mod pallet {
15331533
/// ============================
15341534
/// ==== Rate Limiting =====
15351535
/// ============================
1536-
/// --- MAP ( RateLimitKey ) --> Block number in which the last rate limited operation occured
1536+
/// --- MAP ( RateLimitKey ) --> Block number in which the last rate limited operation occurred
15371537
#[pallet::storage]
15381538
pub type LastRateLimitedBlock<T: Config> =
15391539
StorageMap<_, Identity, RateLimitKey<T::AccountId>, u64, ValueQuery, DefaultZeroU64<T>>;
@@ -1583,7 +1583,7 @@ pub mod pallet {
15831583
/// --- MAP ( netuid ) --> network_is_added
15841584
#[pallet::storage]
15851585
pub type NetworksAdded<T: Config> =
1586-
StorageMap<_, Identity, NetUid, bool, ValueQuery, DefaultNeworksAdded<T>>;
1586+
StorageMap<_, Identity, NetUid, bool, ValueQuery, DefaultNetworksAdded<T>>;
15871587

15881588
/// --- DMAP ( hotkey, netuid ) --> bool
15891589
#[pallet::storage]
@@ -1640,7 +1640,7 @@ pub mod pallet {
16401640

16411641
/// --- MAP ( netuid ) --> last_mechanism_step_block
16421642
#[pallet::storage]
1643-
pub type LastMechansimStepBlock<T> =
1643+
pub type LastMechanismStepBlock<T> =
16441644
StorageMap<_, Identity, NetUid, u64, ValueQuery, DefaultLastMechanismStepBlock<T>>;
16451645

16461646
/// --- MAP ( netuid ) --> subnet_owner
@@ -2624,7 +2624,7 @@ impl<T: Config + pallet_balances::Config<Balance = u64>>
26242624
}
26252625

26262626
/// Enum that defines types of rate limited operations for
2627-
/// storing last block when this operation occured
2627+
/// storing last block when this operation occurred
26282628
#[derive(Encode, Decode, Clone, PartialEq, Eq, Debug, TypeInfo)]
26292629
pub enum RateLimitKey<AccountId> {
26302630
// The setting sn owner hotkey operation is rate limited per netuid

pallets/subtensor/src/migrations/migrate_commit_reveal_settings.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use alloc::string::String;
22

3-
use crate::MIN_COMMIT_REVEAL_PEROIDS;
3+
use crate::MIN_COMMIT_REVEAL_PERIODS;
44
use frame_support::IterableStorageMap;
55
use frame_support::{traits::Get, weights::Weight};
66
use subtensor_runtime_common::NetUid;
@@ -45,7 +45,7 @@ pub fn migrate_commit_reveal_settings<T: Config>() -> Weight {
4545
}
4646

4747
if RevealPeriodEpochs::<T>::get(*netuid) == 0 {
48-
RevealPeriodEpochs::<T>::insert(*netuid, MIN_COMMIT_REVEAL_PEROIDS);
48+
RevealPeriodEpochs::<T>::insert(*netuid, MIN_COMMIT_REVEAL_PERIODS);
4949
weight = weight.saturating_add(T::DbWeight::get().writes(1));
5050
}
5151
}

pallets/subtensor/src/rpc_info/dynamic_info.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl<T: Config> Pallet<T> {
3737
if !Self::if_subnet_exist(netuid) {
3838
return None;
3939
}
40-
let last_step: u64 = LastMechansimStepBlock::<T>::get(netuid);
40+
let last_step: u64 = LastMechanismStepBlock::<T>::get(netuid);
4141
let current_block: u64 = Pallet::<T>::get_current_block_as_u64();
4242
let blocks_since_last_step: u64 = current_block.saturating_sub(last_step);
4343
Some(DynamicInfo {

pallets/subtensor/src/rpc_info/metagraph.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ pub struct Metagraph<AccountId: TypeInfo + Encode + Decode> {
9090
coldkeys: Vec<AccountId>, // coldkey per UID
9191
identities: Vec<Option<ChainIdentityOfV2>>, // coldkeys identities
9292
axons: Vec<AxonInfo>, // UID axons
93-
active: Vec<bool>, // Avtive per UID
93+
active: Vec<bool>, // Active per UID
9494
validator_permit: Vec<bool>, // Val permit per UID
9595
pruning_score: Vec<Compact<u16>>, // Pruning per UID
9696
last_update: Vec<Compact<u64>>, // Last update per UID
@@ -141,7 +141,7 @@ pub struct SelectiveMetagraph<AccountId: TypeInfo + Encode + Decode + Clone> {
141141
alpha_in_emission: Option<Compact<AlphaCurrency>>, // amount injected outstanding per block
142142
tao_in_emission: Option<Compact<TaoCurrency>>, // amount of tao injected per block
143143
pending_alpha_emission: Option<Compact<AlphaCurrency>>, // pending alpha to be distributed
144-
pending_root_emission: Option<Compact<TaoCurrency>>, // panding tao for root divs to be distributed
144+
pending_root_emission: Option<Compact<TaoCurrency>>, // pending tao for root divs to be distributed
145145
subnet_volume: Option<Compact<u128>>, // volume of the subnet in TAO
146146
moving_price: Option<I96F32>, // subnet moving price.
147147

@@ -190,7 +190,7 @@ pub struct SelectiveMetagraph<AccountId: TypeInfo + Encode + Decode + Clone> {
190190
coldkeys: Option<Vec<AccountId>>, // coldkey per UID
191191
identities: Option<Vec<Option<ChainIdentityOfV2>>>, // coldkeys identities
192192
axons: Option<Vec<AxonInfo>>, // UID axons.
193-
active: Option<Vec<bool>>, // Avtive per UID
193+
active: Option<Vec<bool>>, // Active per UID
194194
validator_permit: Option<Vec<bool>>, // Val permit per UID
195195
pruning_score: Option<Vec<Compact<u16>>>, // Pruning per UID
196196
last_update: Option<Vec<Compact<u64>>>, // Last update per UID
@@ -651,7 +651,7 @@ impl<T: Config> Pallet<T> {
651651
alpha_dividends_per_hotkey.push((hotkey.clone(), alpha_divs.into()));
652652
}
653653
let current_block: u64 = Pallet::<T>::get_current_block_as_u64();
654-
let last_step = LastMechansimStepBlock::<T>::get(netuid);
654+
let last_step = LastMechanismStepBlock::<T>::get(netuid);
655655
let blocks_since_last_step: u64 = current_block.saturating_sub(last_step);
656656
let (total_stake_fl, alpha_stake_fl, tao_stake_fl): (
657657
Vec<I64F64>,
@@ -683,7 +683,7 @@ impl<T: Config> Pallet<T> {
683683
// Tempo terms.
684684
block: current_block.into(), // Block at call.
685685
tempo: Self::get_tempo(netuid).into(), // epoch tempo
686-
last_step: LastMechansimStepBlock::<T>::get(netuid).into(), // last epoch
686+
last_step: LastMechanismStepBlock::<T>::get(netuid).into(), // last epoch
687687
blocks_since_last_step: blocks_since_last_step.into(), // blocks since last epoch.
688688

689689
// Subnet emission terms
@@ -697,7 +697,7 @@ impl<T: Config> Pallet<T> {
697697
pending_alpha_emission: PendingValidatorEmission::<T>::get(netuid)
698698
.saturating_add(PendingServerEmission::<T>::get(netuid))
699699
.into(), // pending alpha to be distributed
700-
pending_root_emission: TaoCurrency::from(0u64).into(), // panding tao for root divs to be distributed
700+
pending_root_emission: TaoCurrency::from(0u64).into(), // pending tao for root divs to be distributed
701701
subnet_volume: subnet_volume.into(),
702702
moving_price: SubnetMovingPrice::<T>::get(netuid),
703703

@@ -950,12 +950,12 @@ impl<T: Config> Pallet<T> {
950950
},
951951
Some(SelectiveMetagraphIndex::LastStep) => SelectiveMetagraph {
952952
netuid: netuid.into(),
953-
last_step: Some(LastMechansimStepBlock::<T>::get(netuid).into()),
953+
last_step: Some(LastMechanismStepBlock::<T>::get(netuid).into()),
954954
..Default::default()
955955
},
956956
Some(SelectiveMetagraphIndex::BlocksSinceLastStep) => {
957957
let current_block: u64 = Pallet::<T>::get_current_block_as_u64();
958-
let last_step = LastMechansimStepBlock::<T>::get(netuid);
958+
let last_step = LastMechanismStepBlock::<T>::get(netuid);
959959
let blocks_since_last_step: u64 = current_block.saturating_sub(last_step);
960960
SelectiveMetagraph {
961961
netuid: netuid.into(),
@@ -1650,13 +1650,13 @@ fn test_selective_metagraph() {
16501650
metagraph.merge_value(&metagraph_name, name_index);
16511651
assert!(metagraph.name.is_some());
16521652

1653-
let alph_low_index: usize = 50;
1653+
let alpha_low_index: usize = 50;
16541654
let metagraph_alpha_low = SelectiveMetagraph::<u32> {
16551655
netuid: NetUid::ROOT.into(),
16561656
alpha_low: Some(0_u16.into()),
16571657
..Default::default()
16581658
};
16591659
assert!(metagraph.alpha_low.is_none());
1660-
metagraph.merge_value(&metagraph_alpha_low, alph_low_index);
1660+
metagraph.merge_value(&metagraph_alpha_low, alpha_low_index);
16611661
assert!(metagraph.alpha_low.is_some());
16621662
}

pallets/subtensor/src/subnets/weights.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use super::*;
22
use crate::epoch::math::*;
3-
use crate::{Error, MAX_COMMIT_REVEAL_PEROIDS, MIN_COMMIT_REVEAL_PEROIDS};
3+
use crate::{Error, MAX_COMMIT_REVEAL_PERIODS, MIN_COMMIT_REVEAL_PERIODS};
44
use codec::Compact;
55
use frame_support::dispatch::DispatchResult;
66
use safe_math::*;
@@ -1288,12 +1288,12 @@ impl<T: Config> Pallet<T> {
12881288

12891289
pub fn set_reveal_period(netuid: NetUid, reveal_period: u64) -> DispatchResult {
12901290
ensure!(
1291-
reveal_period <= MAX_COMMIT_REVEAL_PEROIDS,
1291+
reveal_period <= MAX_COMMIT_REVEAL_PERIODS,
12921292
Error::<T>::RevealPeriodTooLarge
12931293
);
12941294

12951295
ensure!(
1296-
reveal_period >= MIN_COMMIT_REVEAL_PEROIDS,
1296+
reveal_period >= MIN_COMMIT_REVEAL_PERIODS,
12971297
Error::<T>::RevealPeriodTooSmall
12981298
);
12991299

pallets/subtensor/src/tests/coinbase.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3593,15 +3593,15 @@ fn test_coinbase_drain_pending_resets_blockssincelaststep() {
35933593

35943594
let blocks_since_last_step_before = 12345678;
35953595
BlocksSinceLastStep::<Test>::insert(netuid0, blocks_since_last_step_before);
3596-
LastMechansimStepBlock::<Test>::insert(netuid0, 12345); // garbage value
3596+
LastMechanismStepBlock::<Test>::insert(netuid0, 12345); // garbage value
35973597

35983598
// Check that blockssincelaststep is reset to 0 on tempo
35993599
SubtensorModule::drain_pending(&[netuid0], block_number);
36003600

36013601
let blocks_since_last_step_after = BlocksSinceLastStep::<Test>::get(netuid0);
36023602
assert_eq!(blocks_since_last_step_after, 0);
3603-
// Also check LastMechansimStepBlock is set to the block number we ran on
3604-
assert_eq!(LastMechansimStepBlock::<Test>::get(netuid0), block_number);
3603+
// Also check LastMechanismStepBlock is set to the block number we ran on
3604+
assert_eq!(LastMechanismStepBlock::<Test>::get(netuid0), block_number);
36053605
});
36063606
}
36073607

pallets/subtensor/src/tests/epoch.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1696,7 +1696,7 @@ fn test_outdated_weights() {
16961696
U256::from(new_key),
16971697
U256::from(new_key)
16981698
));
1699-
let deregistered_uid: u16 = n - 1; // since uid=n-1 only recieved 1/3 of weight, it will get pruned first
1699+
let deregistered_uid: u16 = n - 1; // since uid=n-1 only received 1/3 of weight, it will get pruned first
17001700
assert_eq!(
17011701
U256::from(new_key),
17021702
SubtensorModule::get_hotkey_for_net_and_uid(netuid, deregistered_uid)
@@ -2078,7 +2078,7 @@ fn test_deregistered_miner_bonds() {
20782078
U256::from(new_key),
20792079
U256::from(new_key)
20802080
));
2081-
let deregistered_uid: u16 = n - 1; // since uid=n-1 only recieved 1/3 of weight, it will get pruned first
2081+
let deregistered_uid: u16 = n - 1; // since uid=n-1 only received 1/3 of weight, it will get pruned first
20822082
assert_eq!(
20832083
U256::from(new_key),
20842084
SubtensorModule::get_hotkey_for_net_and_uid(netuid, deregistered_uid)

pallets/subtensor/src/tests/networks.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ fn dissolve_clears_all_per_subnet_storages() {
379379
PendingRootAlphaDivs::<Test>::insert(net, AlphaCurrency::from(1));
380380
PendingOwnerCut::<Test>::insert(net, AlphaCurrency::from(1));
381381
BlocksSinceLastStep::<Test>::insert(net, 1u64);
382-
LastMechansimStepBlock::<Test>::insert(net, 1u64);
382+
LastMechanismStepBlock::<Test>::insert(net, 1u64);
383383
ServingRateLimit::<Test>::insert(net, 1u64);
384384
Rho::<Test>::insert(net, 1u16);
385385
AlphaSigmoidSteepness::<Test>::insert(net, 1i16);
@@ -535,7 +535,7 @@ fn dissolve_clears_all_per_subnet_storages() {
535535
assert!(!PendingRootAlphaDivs::<Test>::contains_key(net));
536536
assert!(!PendingOwnerCut::<Test>::contains_key(net));
537537
assert!(!BlocksSinceLastStep::<Test>::contains_key(net));
538-
assert!(!LastMechansimStepBlock::<Test>::contains_key(net));
538+
assert!(!LastMechanismStepBlock::<Test>::contains_key(net));
539539
assert!(!ServingRateLimit::<Test>::contains_key(net));
540540
assert!(!Rho::<Test>::contains_key(net));
541541
assert!(!AlphaSigmoidSteepness::<Test>::contains_key(net));

0 commit comments

Comments
 (0)