Migrate remaining old decl_* macros to the new pallet attribute macros (#12271)

* Migrate remaining old decl_* macros to the new pallet attribute macros

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* Apply review suggestions

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* Apply review suggestions

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* use pallet::storage

* Fix dev rpc test

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* Fix service tests

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

Signed-off-by: koushiro <koushiro.cqx@gmail.com>
This commit is contained in:
Qinxuan Chen
2022-09-22 16:53:51 +08:00
committed by GitHub
parent 8a43b42ab1
commit a395fec070
10 changed files with 206 additions and 107 deletions
@@ -17,8 +17,9 @@
//! Tool for creating the genesis block.
use super::{system, wasm_binary_unwrap, AccountId, AuthorityId};
use super::{system, wasm_binary_unwrap, AccountId, AuthorityId, Runtime};
use codec::{Encode, Joiner, KeyedVec};
use frame_support::traits::GenesisBuild;
use sc_service::client::genesis;
use sp_core::{
map,
@@ -80,10 +81,11 @@ impl GenesisConfig {
// Assimilate the system genesis config.
let mut storage =
Storage { top: map, children_default: self.extra_storage.children_default.clone() };
let config = system::GenesisConfig { authorities: self.authorities.clone() };
config
.assimilate_storage(&mut storage)
.expect("Adding `system::GensisConfig` to the genesis");
<system::GenesisConfig as GenesisBuild<Runtime>>::assimilate_storage(
&system::GenesisConfig { authorities: self.authorities.clone() },
&mut storage,
)
.expect("Adding `system::GensisConfig` to the genesis");
storage
}