mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-16 14:21:10 +00:00
Improve fees module (#1821)
* remove amount associated * make a new trait to bound some arithmetics to balances or assets: It also remove arithmetic bounds of srml-support::traits::Currency. To update your code then use srml_support::traits::ArithmeticType like: `type Currency: ArithmeticType + Currency<Self::AccountId, Balance=BalanceOf<Self>>; ` with `type BalanceOf<T> = <<T as Trait>::Currency as ArithmeticType>::Type; ` * improve decl_storage when it explicit serde bound: basically don't try to be smarter than rust and just use where clause.
This commit is contained in:
@@ -25,7 +25,7 @@ use runtime_primitives::{
|
||||
};
|
||||
use primitives::{H256, Blake2Hasher};
|
||||
use runtime_io;
|
||||
use srml_support::{impl_outer_origin, impl_outer_event};
|
||||
use srml_support::{impl_outer_origin, impl_outer_event, traits::ArithmeticType};
|
||||
use crate::{GenesisConfig, Module, Trait, system};
|
||||
|
||||
impl_outer_origin!{
|
||||
@@ -52,6 +52,10 @@ impl<AccountId> TransferAsset<AccountId> for TransferAssetMock {
|
||||
fn add_to(_: &AccountId, _: Self::Amount) -> Result<(), &'static str> { Ok(()) }
|
||||
}
|
||||
|
||||
impl ArithmeticType for TransferAssetMock {
|
||||
type Type = u64;
|
||||
}
|
||||
|
||||
// Workaround for https://github.com/rust-lang/rust/issues/26925 . Remove when sorted.
|
||||
#[derive(Clone, PartialEq, Eq, Debug)]
|
||||
pub struct Test;
|
||||
@@ -69,8 +73,7 @@ impl system::Trait for Test {
|
||||
type Log = DigestItem;
|
||||
}
|
||||
impl Trait for Test {
|
||||
type Amount = u64;
|
||||
type Event =TestEvent;
|
||||
type Event = TestEvent;
|
||||
type TransferAsset = TransferAssetMock;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user