mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-15 01:01:04 +00:00
Migrate pallet-treasury to the new pallet attribute macro (#9197)
* Migrate pallet-treasury to the new pallet attribute macro Signed-off-by: koushiro <koushiro.cqx@gmail.com> * Fix bounties/tips tests Signed-off-by: koushiro <koushiro.cqx@gmail.com> * fix Signed-off-by: koushiro <koushiro.cqx@gmail.com> * Update frame/treasury/src/lib.rs Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com> * Update frame/treasury/src/lib.rs Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com> * use `GenesisBuild` * fix imports Co-authored-by: thiolliere <gui.thiolliere@gmail.com> Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
@@ -19,13 +19,7 @@
|
||||
|
||||
#![cfg(test)]
|
||||
|
||||
use crate as treasury;
|
||||
use super::*;
|
||||
use std::cell::RefCell;
|
||||
use frame_support::{
|
||||
assert_noop, assert_ok, parameter_types,
|
||||
traits::OnInitialize, PalletId
|
||||
};
|
||||
|
||||
use sp_core::H256;
|
||||
use sp_runtime::{
|
||||
@@ -33,6 +27,14 @@ use sp_runtime::{
|
||||
traits::{BlakeTwo256, IdentityLookup},
|
||||
};
|
||||
|
||||
use frame_support::{
|
||||
assert_noop, assert_ok, parameter_types,
|
||||
traits::OnInitialize, PalletId, pallet_prelude::GenesisBuild,
|
||||
};
|
||||
|
||||
use crate as treasury;
|
||||
use super::*;
|
||||
|
||||
type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;
|
||||
type Block = frame_system::mocking::MockBlock<Test>;
|
||||
|
||||
@@ -129,7 +131,7 @@ pub fn new_test_ext() -> sp_io::TestExternalities {
|
||||
// Total issuance will be 200 with treasury account initialized at ED.
|
||||
balances: vec![(0, 100), (1, 98), (2, 1)],
|
||||
}.assimilate_storage(&mut t).unwrap();
|
||||
treasury::GenesisConfig::default().assimilate_storage::<Test, _>(&mut t).unwrap();
|
||||
GenesisBuild::<Test>::assimilate_storage(&crate::GenesisConfig, &mut t).unwrap();
|
||||
t.into()
|
||||
}
|
||||
|
||||
@@ -355,7 +357,7 @@ fn genesis_funding_works() {
|
||||
// Total issuance will be 200 with treasury account initialized with 100.
|
||||
balances: vec![(0, 100), (Treasury::account_id(), initial_funding)],
|
||||
}.assimilate_storage(&mut t).unwrap();
|
||||
treasury::GenesisConfig::default().assimilate_storage::<Test, _>(&mut t).unwrap();
|
||||
GenesisBuild::<Test>::assimilate_storage(&crate::GenesisConfig, &mut t).unwrap();
|
||||
let mut t: sp_io::TestExternalities = t.into();
|
||||
|
||||
t.execute_with(|| {
|
||||
|
||||
Reference in New Issue
Block a user