mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-22 12:35:42 +00:00
Update Balances Pallet for decl_error! (#4405)
* Update balances for `decl_error!` * Update for new `decl_error` * Fix staking tests * Use `ok_or` over `match`
This commit is contained in:
@@ -27,7 +27,7 @@ use crate::{GenesisConfig, Module, Trait};
|
||||
|
||||
use frame_system as system;
|
||||
impl_outer_origin!{
|
||||
pub enum Origin for Runtime {}
|
||||
pub enum Origin for Test {}
|
||||
}
|
||||
|
||||
thread_local! {
|
||||
@@ -53,14 +53,14 @@ impl Get<u64> for CreationFee {
|
||||
|
||||
// Workaround for https://github.com/rust-lang/rust/issues/26925 . Remove when sorted.
|
||||
#[derive(Clone, PartialEq, Eq, Debug)]
|
||||
pub struct Runtime;
|
||||
pub struct Test;
|
||||
parameter_types! {
|
||||
pub const BlockHashCount: u64 = 250;
|
||||
pub const MaximumBlockWeight: Weight = 1024;
|
||||
pub const MaximumBlockLength: u32 = 2 * 1024;
|
||||
pub const AvailableBlockRatio: Perbill = Perbill::one();
|
||||
}
|
||||
impl frame_system::Trait for Runtime {
|
||||
impl frame_system::Trait for Test {
|
||||
type Origin = Origin;
|
||||
type Index = u64;
|
||||
type BlockNumber = u64;
|
||||
@@ -82,15 +82,15 @@ parameter_types! {
|
||||
pub const TransactionBaseFee: u64 = 0;
|
||||
pub const TransactionByteFee: u64 = 1;
|
||||
}
|
||||
impl pallet_transaction_payment::Trait for Runtime {
|
||||
type Currency = Module<Runtime>;
|
||||
impl pallet_transaction_payment::Trait for Test {
|
||||
type Currency = Module<Test>;
|
||||
type OnTransactionPayment = ();
|
||||
type TransactionBaseFee = TransactionBaseFee;
|
||||
type TransactionByteFee = TransactionByteFee;
|
||||
type WeightToFee = ConvertInto;
|
||||
type FeeMultiplierUpdate = ();
|
||||
}
|
||||
impl Trait for Runtime {
|
||||
impl Trait for Test {
|
||||
type Balance = u64;
|
||||
type OnFreeBalanceZero = ();
|
||||
type OnNewAccount = ();
|
||||
@@ -152,8 +152,8 @@ impl ExtBuilder {
|
||||
}
|
||||
pub fn build(self) -> sp_io::TestExternalities {
|
||||
self.set_associated_consts();
|
||||
let mut t = frame_system::GenesisConfig::default().build_storage::<Runtime>().unwrap();
|
||||
GenesisConfig::<Runtime> {
|
||||
let mut t = frame_system::GenesisConfig::default().build_storage::<Test>().unwrap();
|
||||
GenesisConfig::<Test> {
|
||||
balances: if self.monied {
|
||||
vec![
|
||||
(1, 10 * self.existential_deposit),
|
||||
@@ -179,10 +179,10 @@ impl ExtBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
pub type System = frame_system::Module<Runtime>;
|
||||
pub type Balances = Module<Runtime>;
|
||||
pub type System = frame_system::Module<Test>;
|
||||
pub type Balances = Module<Test>;
|
||||
|
||||
pub const CALL: &<Runtime as frame_system::Trait>::Call = &();
|
||||
pub const CALL: &<Test as frame_system::Trait>::Call = &();
|
||||
|
||||
/// create a transaction info struct from weight. Handy to avoid building the whole struct.
|
||||
pub fn info_from_weight(w: Weight) -> DispatchInfo {
|
||||
|
||||
Reference in New Issue
Block a user