mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 09:21:05 +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:
@@ -79,10 +79,14 @@ pub enum UpdateBalanceOutcome {
|
||||
AccountKilled,
|
||||
}
|
||||
|
||||
pub trait ArithmeticType {
|
||||
type Type: SimpleArithmetic + As<usize> + As<u64> + Codec + Copy + MaybeSerializeDebug + Default;
|
||||
}
|
||||
|
||||
/// Abstraction over a fungible assets system.
|
||||
pub trait Currency<AccountId> {
|
||||
/// The balance of an account.
|
||||
type Balance: SimpleArithmetic + As<usize> + As<u64> + Codec + Copy + MaybeSerializeDebug + Default;
|
||||
type Balance;
|
||||
|
||||
// PUBLIC IMMUTABLES
|
||||
|
||||
|
||||
Reference in New Issue
Block a user