Skip to content

Commit

Permalink
lints, bump spec version
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Dare committed Jul 7, 2024
1 parent 5b5ac3a commit b41a2d5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions pallets/subtensor/src/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -565,23 +565,23 @@ pub fn migrate_populate_staking_hotkeys<T: Config>() -> Weight {
if stake > 0 {
let mut hotkeys = StakingHotkeys::<T>::get(&coldkey);
storage_reads = storage_reads.saturating_add(1); // Read from StakingHotkeys storage

// Add the hotkey if it's not already in the vector
if !hotkeys.contains(&hotkey) {
hotkeys.push(hotkey);
keys_touched = keys_touched.saturating_add(1);

// Update longest hotkey vector info
if longest_hotkey_vector < hotkeys.len() {
longest_hotkey_vector = hotkeys.len();
longest_coldkey = Some(coldkey.clone());
}

// Update the StakingHotkeys storage
StakingHotkeys::<T>::insert(&coldkey, hotkeys);
storage_writes = storage_writes.saturating_add(1); // Write to StakingHotkeys storage
}

// Accrue weight for reads and writes
weight = weight.saturating_add(T::DbWeight::get().reads_writes(2, 1));
}
Expand All @@ -603,4 +603,3 @@ pub fn migrate_populate_staking_hotkeys<T: Config>() -> Weight {
Weight::zero()
}
}

4 changes: 2 additions & 2 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// `spec_version`, and `authoring_version` are the same between Wasm and native.
// This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use
// the compatible custom types.
spec_version: 159,
spec_version: 160,
impl_version: 1,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down Expand Up @@ -294,7 +294,7 @@ parameter_types! {

pub const RootEnterDuration: BlockNumber = 5 * 60 * 24; // 24 hours

pub const RootExtendDuration: BlockNumber = 5 * 60 * 3; // 3 hours
pub const RootExtendDuration: BlockNumber = 5 * 60 * 12; // 12 hours

pub const DisallowPermissionlessEntering: Option<Balance> = None;
pub const DisallowPermissionlessExtending: Option<Balance> = None;
Expand Down

0 comments on commit b41a2d5

Please sign in to comment.