mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-19 03:01:02 +00:00
Allow ExistentialDeposit = 0 (#6185)
* Allow ExistentialDeposit = 0 * there are better ways to check is an account exists * fix StorageMapShim * test account events and fix some bugs
This commit is contained in:
@@ -26,7 +26,7 @@ use sp_runtime::{
|
||||
};
|
||||
use sp_core::H256;
|
||||
use sp_io;
|
||||
use frame_support::{impl_outer_origin, parameter_types};
|
||||
use frame_support::{impl_outer_origin, impl_outer_event, parameter_types};
|
||||
use frame_support::traits::Get;
|
||||
use frame_support::weights::{Weight, DispatchInfo, IdentityFee};
|
||||
use std::cell::RefCell;
|
||||
@@ -37,6 +37,17 @@ impl_outer_origin!{
|
||||
pub enum Origin for Test {}
|
||||
}
|
||||
|
||||
mod balances {
|
||||
pub use crate::Event;
|
||||
}
|
||||
|
||||
impl_outer_event! {
|
||||
pub enum Event for Test {
|
||||
system<T>,
|
||||
balances<T>,
|
||||
}
|
||||
}
|
||||
|
||||
thread_local! {
|
||||
static EXISTENTIAL_DEPOSIT: RefCell<u64> = RefCell::new(0);
|
||||
}
|
||||
@@ -65,7 +76,7 @@ impl frame_system::Trait for Test {
|
||||
type AccountId = u64;
|
||||
type Lookup = IdentityLookup<Self::AccountId>;
|
||||
type Header = Header;
|
||||
type Event = ();
|
||||
type Event = Event;
|
||||
type BlockHashCount = BlockHashCount;
|
||||
type MaximumBlockWeight = MaximumBlockWeight;
|
||||
type DbWeight = ();
|
||||
@@ -93,7 +104,7 @@ impl pallet_transaction_payment::Trait for Test {
|
||||
impl Trait for Test {
|
||||
type Balance = u64;
|
||||
type DustRemoval = ();
|
||||
type Event = ();
|
||||
type Event = Event;
|
||||
type ExistentialDeposit = ExistentialDeposit;
|
||||
type AccountStore = system::Module<Test>;
|
||||
}
|
||||
@@ -138,7 +149,10 @@ impl ExtBuilder {
|
||||
vec![]
|
||||
},
|
||||
}.assimilate_storage(&mut t).unwrap();
|
||||
t.into()
|
||||
|
||||
let mut ext = sp_io::TestExternalities::new(t);
|
||||
ext.execute_with(|| System::set_block_number(1));
|
||||
ext
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user