Skip to content

Commit

Permalink
Added weights
Browse files Browse the repository at this point in the history
  • Loading branch information
mqxf committed Feb 8, 2024
1 parent a8d95f1 commit 3c74f5a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pallets/gear-messenger/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,8 @@ mod tests {
}

let state = MigrateToV3::<Test>::pre_upgrade().unwrap();
let _ = MigrateToV3::<Test>::on_runtime_upgrade();
let weight = MigrateToV3::<Test>::on_runtime_upgrade();
assert!(!weight.is_zero());
MigrateToV3::<Test>::post_upgrade(state).unwrap();

assert_eq!(StorageVersion::get::<GearMessenger>(), 3);
Expand Down
3 changes: 2 additions & 1 deletion pallets/gear-messenger/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use crate as pallet_gear_messenger;
use frame_support::{
construct_runtime, parameter_types,
traits::{OnFinalize, OnInitialize},
weights::constants::RocksDbWeight,
};
use frame_system::{self as system, pallet_prelude::BlockNumberFor};
use primitive_types::H256;
Expand All @@ -47,7 +48,7 @@ construct_runtime!(
}
);

common::impl_pallet_system!(Test, DbWeight = (), BlockWeights = ());
common::impl_pallet_system!(Test, DbWeight = RocksDbWeight, BlockWeights = ());
common::impl_pallet_balances!(Test);
pallet_gear_gas::impl_config!(Test);
pallet_gear_messenger::impl_config!(Test);
Expand Down

0 comments on commit 3c74f5a

Please sign in to comment.