Skip to content

Commit

Permalink
chore: initialize defaults for farming policy id / connectionprice
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanVerstraete committed Jun 14, 2022
1 parent 92eec83 commit 7d22d2a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 0 additions & 7 deletions substrate-node/pallets/pallet-tfgrid/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,6 @@ decl_module! {

fn deposit_event() = default;

fn on_runtime_upgrade() -> frame_support::weights::Weight {
frame_support::debug::info!("Resetting farming policy ID map...");
FarmingPolicyID::put(0);
frame_support::debug::info!("Resetting farming policy ID map done!");
100_000_000
}

#[weight = 100_000_000 + T::DbWeight::get().writes(1)]
pub fn set_storage_version(origin, version: types::StorageVersion) -> dispatch::DispatchResult {
T::RestrictedOrigin::ensure_origin(origin)?;
Expand Down
7 changes: 7 additions & 0 deletions substrate-node/runtime/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,14 @@ impl frame_support::traits::OnRuntimeUpgrade for InsertNewFarmingPolicies {
pallet_tfgrid::FarmingPoliciesMap::<Runtime>::insert(2, farming_policy_2);

// Update internal ID
frame_support::debug::info!("Resetting farming policy ID map...");
pallet_tfgrid::FarmingPolicyID::put(2);
frame_support::debug::info!("Resetting farming policy ID map done!");

// Set default connection price
frame_support::debug::info!("Initializing default connection price...");
pallet_tfgrid::ConnectionPrice::put(80);
frame_support::debug::info!("Initializing default connection price done!");

<Runtime as frame_system::Config>::DbWeight::get().writes(3)
}
Expand Down

0 comments on commit 7d22d2a

Please sign in to comment.