mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 17:31:05 +00:00
Make use of assimilate_storage for GenesisConfig (#1982)
* Make use of `assimilate_storage` for `GenesisConfig` Fixes incorrect initialization of the staking gensis storage. * Add some documentation
This commit is contained in:
@@ -270,6 +270,7 @@ decl_storage! {
|
||||
build(|storage: &mut primitives::StorageOverlay, _: &mut primitives::ChildrenStorageOverlay, config: &GenesisConfig<T>| {
|
||||
with_storage(storage, || {
|
||||
for &(ref stash, ref controller, balance) in &config.stakers {
|
||||
assert!(T::Currency::free_balance(&stash) >= balance);
|
||||
let _ = <Module<T>>::bond(T::Origin::from(Some(stash.clone()).into()), T::Lookup::unlookup(controller.clone()), balance, RewardDestination::Staked);
|
||||
let _ = <Module<T>>::validate(T::Origin::from(Some(controller.clone()).into()), Default::default());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user