Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions pallets/subtensor/src/coinbase/block_emission.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ impl<T: Config> Pallet<T> {
.saturating_mul(I96F32::saturating_from_num(DefaultBlockEmission::<T>::get()));
// Convert to u64
let block_emission_u64: u64 = block_emission.saturating_to_num::<u64>();
if BlockEmission::<T>::get() != block_emission_u64 {
BlockEmission::<T>::put(block_emission_u64);
}
Ok(block_emission_u64)
}
}
4 changes: 0 additions & 4 deletions pallets/subtensor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1241,10 +1241,6 @@ pub mod pallet {
/// ==================
/// ==== Coinbase ====
/// ==================
/// --- ITEM ( global_block_emission )
#[pallet::storage]
pub type BlockEmission<T> = StorageValue<_, u64, ValueQuery, DefaultBlockEmission<T>>;

/// --- DMap ( hot, netuid ) --> emission | last hotkey emission on network.
#[pallet::storage]
pub type LastHotkeyEmissionOnNetuid<T: Config> = StorageDoubleMap<
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
use super::*;
use crate::HasMigrationRun;
use frame_support::{traits::Get, weights::Weight};
use scale_info::prelude::string::String;
use sp_io::storage::clear;

pub fn migrate_remove_block_emission_storage<T: Config>() -> Weight {
let migration_name = b"migrate_remove_block_emission_storage".to_vec();
let mut weight = T::DbWeight::get().reads(1);

if HasMigrationRun::<T>::get(&migration_name) {
log::info!(
"Migration '{:?}' has already run. Skipping.",
String::from_utf8_lossy(&migration_name)
);
return weight;
}

log::info!(
"Running migration '{}'",
String::from_utf8_lossy(&migration_name)
);

clear(b"SubtensorModule::BlockEmission");

// Mark Migration as Completed
HasMigrationRun::<T>::insert(&migration_name, true);
weight = weight.saturating_add(T::DbWeight::get().writes(2));

log::info!(
"Migration '{:?}' completed successfully.",
String::from_utf8_lossy(&migration_name)
);

weight
}
Loading