diff --git a/substrate/core/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm b/substrate/core/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm index a7de97ffb9..5adc592d20 100644 Binary files a/substrate/core/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm and b/substrate/core/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm differ diff --git a/substrate/node/cli/src/chain_spec.rs b/substrate/node/cli/src/chain_spec.rs index 7edec08b43..59f22e7c37 100644 --- a/substrate/node/cli/src/chain_spec.rs +++ b/substrate/node/cli/src/chain_spec.rs @@ -150,6 +150,10 @@ fn staging_testnet_config_genesis() -> GenesisConfig { burn: Permill::from_percent(50), }), contract: Some(ContractConfig { + transaction_base_fee: 1 * CENTS, + transaction_byte_fee: 10 * MILLICENTS, + transfer_fee: 1 * CENTS, + creation_fee: 1 * CENTS, contract_fee: 1 * CENTS, call_base_fee: 1000, create_base_fee: 1000, @@ -303,6 +307,10 @@ pub fn testnet_genesis( burn: Permill::from_percent(50), }), contract: Some(ContractConfig { + transaction_base_fee: 1, + transaction_byte_fee: 0, + transfer_fee: 0, + creation_fee: 0, contract_fee: 21, call_base_fee: 135, create_base_fee: 175, diff --git a/substrate/node/runtime/src/lib.rs b/substrate/node/runtime/src/lib.rs index b6d4738572..eb5684c19e 100644 --- a/substrate/node/runtime/src/lib.rs +++ b/substrate/node/runtime/src/lib.rs @@ -59,7 +59,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { impl_name: create_runtime_str!("substrate-node"), authoring_version: 10, spec_version: 46, - impl_version: 46, + impl_version: 47, apis: RUNTIME_API_VERSIONS, }; @@ -167,6 +167,7 @@ impl treasury::Trait for Runtime { } impl contract::Trait for Runtime { + type Currency = balances::Module; type Call = Call; type Event = Event; type Gas = u64; diff --git a/substrate/node/runtime/wasm/Cargo.lock b/substrate/node/runtime/wasm/Cargo.lock index 4bc3dcf6da..396d377ade 100644 --- a/substrate/node/runtime/wasm/Cargo.lock +++ b/substrate/node/runtime/wasm/Cargo.lock @@ -2204,7 +2204,6 @@ dependencies = [ "sr-primitives 0.1.0", "sr-sandbox 0.1.0", "sr-std 0.1.0", - "srml-balances 0.1.0", "srml-support 0.1.0", "srml-system 0.1.0", "srml-timestamp 0.1.0", diff --git a/substrate/node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm b/substrate/node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm index 4ff22ed0e8..9bd3604b42 100644 Binary files a/substrate/node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm and b/substrate/node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm differ diff --git a/substrate/srml/contract/Cargo.toml b/substrate/srml/contract/Cargo.toml index cb4ad0ffc1..ae91f6632d 100644 --- a/substrate/srml/contract/Cargo.toml +++ b/substrate/srml/contract/Cargo.toml @@ -17,7 +17,6 @@ rstd = { package = "sr-std", path = "../../core/sr-std", default-features = fals sandbox = { package = "sr-sandbox", path = "../../core/sr-sandbox", default-features = false } srml-support = { path = "../support", default-features = false } system = { package = "srml-system", path = "../system", default-features = false } -balances = { package = "srml-balances", path = "../balances", default-features = false } timestamp = { package = "srml-timestamp", path = "../timestamp", default-features = false } [dev-dependencies] @@ -25,6 +24,7 @@ wabt = "~0.7.4" assert_matches = "1.1" hex-literal = "0.1.0" consensus = { package = "srml-consensus", path = "../consensus" } +balances = { package = "srml-balances", path = "../balances" } [features] default = ["std"] @@ -36,7 +36,6 @@ std = [ "runtime-primitives/std", "runtime-io/std", "rstd/std", - "balances/std", "sandbox/std", "srml-support/std", "system/std", diff --git a/substrate/srml/contract/src/account_db.rs b/substrate/srml/contract/src/account_db.rs index 1ea763800a..6b5142b6c8 100644 --- a/substrate/srml/contract/src/account_db.rs +++ b/substrate/srml/contract/src/account_db.rs @@ -16,8 +16,8 @@ //! Auxilliaries to help with managing partial changes to accounts state. -use super::{CodeHash, CodeHashOf, Trait, AccountInfo, TrieId, AccountInfoOf}; -use {balances, system}; +use super::{CodeHash, CodeHashOf, Trait, AccountInfo, TrieId, AccountInfoOf, BalanceOf}; +use system; use rstd::cell::RefCell; use rstd::rc::Rc; use rstd::collections::btree_map::{BTreeMap, Entry}; @@ -27,7 +27,7 @@ use srml_support::{StorageMap, traits::{UpdateBalanceOutcome, SignedImbalance, Currency, Imbalance}, storage::child}; pub struct ChangeEntry { - balance: Option, + balance: Option>, /// In the case the outer option is None, the code_hash remains untouched, while providing `Some(None)` signifies a removing of the code in question code: Option>>, storage: BTreeMap, Option>>, @@ -91,7 +91,7 @@ pub trait AccountDb { fn get_or_create_trieid(&self, account: &T::AccountId) -> TrieId; fn get_storage(&self, trie_id: &TrieId, location: &[u8]) -> Option>; fn get_code(&self, account: &T::AccountId) -> Option>; - fn get_balance(&self, account: &T::AccountId) -> T::Balance; + fn get_balance(&self, account: &T::AccountId) -> BalanceOf; fn commit(&mut self, change_set: ChangeSet); } @@ -114,15 +114,15 @@ impl AccountDb for DirectAccountDb { fn get_code(&self, account: &T::AccountId) -> Option> { >::get(account) } - fn get_balance(&self, account: &T::AccountId) -> T::Balance { - balances::Module::::free_balance(account) + fn get_balance(&self, account: &T::AccountId) -> BalanceOf { + T::Currency::free_balance(account) } fn commit(&mut self, s: ChangeSet) { let mut total_imbalance = SignedImbalance::zero(); for (address, changed) in s.into_iter() { let trieid = >::get_or_create_trieid(&self, &address); if let Some(balance) = changed.balance { - let (imbalance, outcome) = balances::Module::::make_free_balance_be(&address, balance); + let (imbalance, outcome) = T::Currency::make_free_balance_be(&address, balance); total_imbalance = total_imbalance.merge(imbalance); if let UpdateBalanceOutcome::AccountKilled = outcome { // Account killed. This will ultimately lead to calling `OnFreeBalanceZero` callback @@ -206,7 +206,7 @@ impl<'a, T: Trait> OverlayAccountDb<'a, T> { .or_insert(Default::default()) .code = Some(code); } - pub fn set_balance(&mut self, account: &T::AccountId, balance: T::Balance) { + pub fn set_balance(&mut self, account: &T::AccountId, balance: BalanceOf) { self.local .borrow_mut() .entry(account.clone()) @@ -257,7 +257,7 @@ impl<'a, T: Trait> AccountDb for OverlayAccountDb<'a, T> { .and_then(|a| a.code.clone()) .unwrap_or_else(|| self.underlying.get_code(account)) } - fn get_balance(&self, account: &T::AccountId) -> T::Balance { + fn get_balance(&self, account: &T::AccountId) -> BalanceOf { self.local .borrow() .get(account) diff --git a/substrate/srml/contract/src/exec.rs b/substrate/srml/contract/src/exec.rs index 011f1d9e1e..6c04a2e1d0 100644 --- a/substrate/srml/contract/src/exec.rs +++ b/substrate/srml/contract/src/exec.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -use super::{CodeHash, Config, ContractAddressFor, Event, RawEvent, Trait, TrieId}; +use super::{CodeHash, Config, ContractAddressFor, Event, RawEvent, Trait, TrieId, BalanceOf}; use crate::account_db::{AccountDb, DirectAccountDb, OverlayAccountDb, AccountTrieIdMapping}; use crate::gas::{GasMeter, Token, approx_gas_for_balance}; @@ -25,7 +25,6 @@ use runtime_primitives::traits::{CheckedAdd, CheckedSub, Zero}; use srml_support::traits::{WithdrawReason, Currency}; use timestamp; -pub type BalanceOf = ::Balance; pub type AccountIdOf = ::AccountId; pub type CallOf = ::Call; pub type MomentOf = ::Moment; @@ -281,7 +280,7 @@ where pub fn call( &mut self, dest: T::AccountId, - value: T::Balance, + value: BalanceOf, gas_meter: &mut GasMeter, input_data: &[u8], empty_output_buf: EmptyOutputBuf, @@ -306,7 +305,7 @@ where dest.clone() ); - if value > T::Balance::zero() { + if value > BalanceOf::::zero() { transfer( gas_meter, TransferCause::Call, @@ -349,7 +348,7 @@ where pub fn instantiate( &mut self, - endowment: T::Balance, + endowment: BalanceOf, gas_meter: &mut GasMeter, code_hash: &CodeHash, input_data: &[u8], @@ -439,7 +438,7 @@ pub struct TransferFeeToken { gas_price: Balance, } -impl Token for TransferFeeToken { +impl Token for TransferFeeToken> { type Metadata = Config; #[inline] @@ -468,7 +467,7 @@ enum TransferCause { /// (transfering endowment) or because of a transfer via `call`. This /// is specified using the `cause` parameter. /// -/// NOTE: that the fee is denominated in `T::Balance` units, but +/// NOTE: that the fee is denominated in `BalanceOf` units, but /// charged in `T::Gas` from the provided `gas_meter`. This means /// that the actual amount charged might differ. /// @@ -480,7 +479,7 @@ fn transfer<'a, T: Trait, V: Vm, L: Loader>( cause: TransferCause, transactor: &T::AccountId, dest: &T::AccountId, - value: T::Balance, + value: BalanceOf, ctx: &mut ExecutionContext<'a, T, V, L>, ) -> Result<(), &'static str> { use self::TransferCause::*; @@ -528,7 +527,7 @@ fn transfer<'a, T: Trait, V: Vm, L: Loader>( if would_create && value < ctx.config.existential_deposit { return Err("value too low to create account"); } - >::ensure_can_withdraw(transactor, value, WithdrawReason::Transfer, new_from_balance)?; + T::Currency::ensure_can_withdraw(transactor, value, WithdrawReason::Transfer, new_from_balance)?; let new_to_balance = match to_balance.checked_add(&value) { Some(b) => b, @@ -548,7 +547,7 @@ fn transfer<'a, T: Trait, V: Vm, L: Loader>( struct CallContext<'a, 'b: 'a, T: Trait + 'b, V: Vm + 'b, L: Loader> { ctx: &'a mut ExecutionContext<'b, T, V, L>, caller: T::AccountId, - value_transferred: T::Balance, + value_transferred: BalanceOf, timestamp: T::Moment, random_seed: T::Hash, } @@ -574,7 +573,7 @@ where fn instantiate( &mut self, code_hash: &CodeHash, - endowment: T::Balance, + endowment: BalanceOf, gas_meter: &mut GasMeter, input_data: &[u8], ) -> Result>, &'static str> { @@ -584,7 +583,7 @@ where fn call( &mut self, to: &T::AccountId, - value: T::Balance, + value: BalanceOf, gas_meter: &mut GasMeter, input_data: &[u8], empty_output_buf: EmptyOutputBuf, @@ -608,11 +607,11 @@ where &self.caller } - fn balance(&self) -> T::Balance { + fn balance(&self) -> BalanceOf { self.ctx.overlay.get_balance(&self.ctx.self_account) } - fn value_transferred(&self) -> T::Balance { + fn value_transferred(&self) -> BalanceOf { self.value_transferred } diff --git a/substrate/srml/contract/src/gas.rs b/substrate/srml/contract/src/gas.rs index 205a422871..54199042bc 100644 --- a/substrate/srml/contract/src/gas.rs +++ b/substrate/srml/contract/src/gas.rs @@ -14,8 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -use crate::{GasSpent, Module, Trait}; -use balances; +use crate::{GasSpent, Module, Trait, BalanceOf, NegativeImbalanceOf}; use runtime_primitives::BLOCK_FULL; use runtime_primitives::traits::{As, CheckedMul, CheckedSub, Zero}; use srml_support::{StorageValue, traits::{OnUnbalanced, ExistenceRequirement, WithdrawReason, Currency, Imbalance}}; @@ -83,14 +82,14 @@ pub struct GasMeter { limit: T::Gas, /// Amount of gas left from initial gas limit. Can reach zero. gas_left: T::Gas, - gas_price: T::Balance, + gas_price: BalanceOf, #[cfg(test)] tokens: Vec, } impl GasMeter { #[cfg(test)] - pub fn with_limit(gas_limit: T::Gas, gas_price: T::Balance) -> GasMeter { + pub fn with_limit(gas_limit: T::Gas, gas_price: BalanceOf) -> GasMeter { GasMeter { limit: gas_limit, gas_left: gas_limit, @@ -175,7 +174,7 @@ impl GasMeter { } } - pub fn gas_price(&self) -> T::Balance { + pub fn gas_price(&self) -> BalanceOf { self.gas_price } @@ -202,7 +201,7 @@ impl GasMeter { pub fn buy_gas( transactor: &T::AccountId, gas_limit: T::Gas, -) -> Result<(GasMeter, balances::NegativeImbalance), &'static str> { +) -> Result<(GasMeter, NegativeImbalanceOf), &'static str> { // Check if the specified amount of gas is available in the current block. // This cannot underflow since `gas_spent` is never greater than `block_gas_limit`. let gas_available = >::block_gas_limit() - >::gas_spent(); @@ -213,11 +212,11 @@ pub fn buy_gas( // Buy the specified amount of gas. let gas_price = >::gas_price(); - let cost = >::as_(gas_limit.clone()) + let cost = >>::as_(gas_limit.clone()) .checked_mul(&gas_price) .ok_or("overflow multiplying gas limit by price")?; - let imbalance = >::withdraw( + let imbalance = T::Currency::withdraw( transactor, cost, WithdrawReason::Fee, @@ -238,7 +237,7 @@ pub fn buy_gas( pub fn refund_unused_gas( transactor: &T::AccountId, gas_meter: GasMeter, - imbalance: balances::NegativeImbalance, + imbalance: NegativeImbalanceOf, ) { let gas_spent = gas_meter.spent(); let gas_left = gas_meter.gas_left(); @@ -249,8 +248,8 @@ pub fn refund_unused_gas( >::mutate(|block_gas_spent| *block_gas_spent += gas_spent); // Refund gas left by the price it was bought. - let refund = >::as_(gas_left) * gas_meter.gas_price; - let refund_imbalance = >::deposit_creating(transactor, refund); + let refund = >>::as_(gas_left) * gas_meter.gas_price; + let refund_imbalance = T::Currency::deposit_creating(transactor, refund); if let Ok(imbalance) = imbalance.offset(refund_imbalance) { T::GasPayment::on_unbalanced(imbalance); } @@ -258,9 +257,9 @@ pub fn refund_unused_gas( /// A little handy utility for converting a value in balance units into approximitate value in gas units /// at the given gas price. -pub fn approx_gas_for_balance(gas_price: T::Balance, balance: T::Balance) -> T::Gas { - let amount_in_gas: T::Balance = balance / gas_price; - >::sa(amount_in_gas) +pub fn approx_gas_for_balance(gas_price: BalanceOf, balance: BalanceOf) -> T::Gas { + let amount_in_gas: BalanceOf = balance / gas_price; + >>::sa(amount_in_gas) } /// A simple utility macro that helps to match against a diff --git a/substrate/srml/contract/src/lib.rs b/substrate/srml/contract/src/lib.rs index 2c2d2106a6..63b425eba4 100644 --- a/substrate/srml/contract/src/lib.rs +++ b/substrate/srml/contract/src/lib.rs @@ -74,7 +74,7 @@ use parity_codec::{Codec, Encode, Decode}; use runtime_primitives::traits::{Hash, As, SimpleArithmetic,Bounded, StaticLookup}; use srml_support::dispatch::{Result, Dispatchable}; use srml_support::{Parameter, StorageMap, StorageValue, decl_module, decl_event, decl_storage, storage::child}; -use srml_support::traits::{OnFreeBalanceZero, OnUnbalanced}; +use srml_support::traits::{OnFreeBalanceZero, OnUnbalanced, Currency}; use system::{ensure_signed, RawOrigin}; use timestamp; @@ -133,7 +133,12 @@ where } } -pub trait Trait: balances::Trait + timestamp::Trait { +pub type BalanceOf = <::Currency as Currency<::AccountId>>::Balance; +pub type NegativeImbalanceOf = <::Currency as Currency<::AccountId>>::NegativeImbalance; + +pub trait Trait: timestamp::Trait { + type Currency: Currency; + /// The outer call dispatch type. type Call: Parameter + Dispatchable::Origin>; @@ -141,7 +146,7 @@ pub trait Trait: balances::Trait + timestamp::Trait { type Event: From> + Into<::Event>; // As is needed for wasm-utils - type Gas: Parameter + Default + Codec + SimpleArithmetic + Bounded + Copy + As + As + As; + type Gas: Parameter + Default + Codec + SimpleArithmetic + Bounded + Copy + As> + As + As; /// A function type to get the contract address given the creator. type DetermineContractAddress: ContractAddressFor, Self::AccountId>; @@ -150,12 +155,13 @@ pub trait Trait: balances::Trait + timestamp::Trait { /// /// It is recommended (though not required) for this function to return a fee that would be taken /// by executive module for regular dispatch. - type ComputeDispatchFee: ComputeDispatchFee::Balance>; + type ComputeDispatchFee: ComputeDispatchFee>; + /// trieid id generator type TrieIdGenerator: TrieIdGenerator; /// Handler for the unbalanced reduction when making a gas payment. - type GasPayment: OnUnbalanced>; + type GasPayment: OnUnbalanced>; } /// Simple contract address determintator. @@ -184,12 +190,12 @@ where /// The default dispatch fee computor computes the fee in the same way that /// implementation of `MakePayment` for balances module does. pub struct DefaultDispatchFeeComputor(PhantomData); -impl ComputeDispatchFee for DefaultDispatchFeeComputor { - fn compute_dispatch_fee(call: &T::Call) -> T::Balance { +impl ComputeDispatchFee> for DefaultDispatchFeeComputor { + fn compute_dispatch_fee(call: &T::Call) -> BalanceOf { let encoded_len = call.using_encoded(|encoded| encoded.len()); - let base_fee = >::transaction_base_fee(); - let byte_fee = >::transaction_byte_fee(); - base_fee + byte_fee * >::sa(encoded_len as u64) + let base_fee = >::transaction_base_fee(); + let byte_fee = >::transaction_byte_fee(); + base_fee + byte_fee * as As>::sa(encoded_len as u64) } } @@ -237,7 +243,7 @@ decl_module! { fn call( origin, dest: ::Source, - #[compact] value: T::Balance, + #[compact] value: BalanceOf, #[compact] gas_limit: T::Gas, data: Vec ) -> Result { @@ -291,7 +297,7 @@ decl_module! { /// upon any message received by this account. fn create( origin, - #[compact] endowment: T::Balance, + #[compact] endowment: BalanceOf, #[compact] gas_limit: T::Gas, code_hash: CodeHash, data: Vec @@ -342,7 +348,7 @@ decl_module! { decl_event! { pub enum Event where - ::Balance, + Balance = BalanceOf, ::AccountId, ::Hash { @@ -366,14 +372,22 @@ decl_event! { decl_storage! { trait Store for Module as Contract { + /// The fee required to make a transfer. + TransferFee get(transfer_fee) config(): BalanceOf; + /// The fee required to create an account. + CreationFee get(creation_fee) config(): BalanceOf; + /// The fee to be paid for making a transaction; the base. + TransactionBaseFee get(transaction_base_fee) config(): BalanceOf; + /// The fee to be paid for making a transaction; the per-byte portion. + TransactionByteFee get(transaction_byte_fee) config(): BalanceOf; /// The fee required to create a contract. - ContractFee get(contract_fee) config(): T::Balance = T::Balance::sa(21); + ContractFee get(contract_fee) config(): BalanceOf = BalanceOf::::sa(21); /// The fee charged for a call into a contract. CallBaseFee get(call_base_fee) config(): T::Gas = T::Gas::sa(135); /// The fee charged for a create of a contract. CreateBaseFee get(create_base_fee) config(): T::Gas = T::Gas::sa(175); /// The price of one unit of gas. - GasPrice get(gas_price) config(): T::Balance = T::Balance::sa(1); + GasPrice get(gas_price) config(): BalanceOf = BalanceOf::::sa(1); /// The maximum nesting level of a call/create stack. MaxDepth get(max_depth) config(): u32 = 100; /// The maximum amount of gas that could be expended per block. @@ -410,11 +424,11 @@ impl OnFreeBalanceZero for Module { /// course of transaction execution. pub struct Config { pub schedule: Schedule, - pub existential_deposit: T::Balance, + pub existential_deposit: BalanceOf, pub max_depth: u32, - pub contract_account_instantiate_fee: T::Balance, - pub account_create_fee: T::Balance, - pub transfer_fee: T::Balance, + pub contract_account_instantiate_fee: BalanceOf, + pub account_create_fee: BalanceOf, + pub transfer_fee: BalanceOf, pub call_base_fee: T::Gas, pub instantiate_base_fee: T::Gas, } @@ -423,11 +437,11 @@ impl Config { fn preload() -> Config { Config { schedule: >::current_schedule(), - existential_deposit: >::existential_deposit(), + existential_deposit: T::Currency::minimum_balance(), max_depth: >::max_depth(), contract_account_instantiate_fee: >::contract_fee(), - account_create_fee: >::creation_fee(), - transfer_fee: >::transfer_fee(), + account_create_fee: >::creation_fee(), + transfer_fee: >::transfer_fee(), call_base_fee: >::call_base_fee(), instantiate_base_fee: >::create_base_fee(), } diff --git a/substrate/srml/contract/src/tests.rs b/substrate/srml/contract/src/tests.rs index 2b4768a7ee..36b98098b0 100644 --- a/substrate/srml/contract/src/tests.rs +++ b/substrate/srml/contract/src/tests.rs @@ -96,6 +96,7 @@ impl consensus::Trait for Test { type InherentOfflineReport = (); } impl Trait for Test { + type Currency = Balances; type Call = Call; type Gas = u64; type DetermineContractAddress = DummyContractAddressFor; @@ -198,6 +199,10 @@ impl ExtBuilder { ); t.extend( GenesisConfig:: { + transaction_base_fee: 0, + transaction_byte_fee: 0, + transfer_fee: self.transfer_fee, + creation_fee: self.creation_fee, contract_fee: 21, call_base_fee: 135, create_base_fee: 175, diff --git a/substrate/srml/contract/src/wasm/runtime.rs b/substrate/srml/contract/src/wasm/runtime.rs index 83f14cdfd7..b4a963f931 100644 --- a/substrate/srml/contract/src/wasm/runtime.rs +++ b/substrate/srml/contract/src/wasm/runtime.rs @@ -16,8 +16,8 @@ //! Environment definition of the wasm smart-contract runtime. -use crate::{Schedule, Trait, CodeHash, ComputeDispatchFee}; -use crate::exec::{Ext, BalanceOf, VmExecResult, OutputBuf, EmptyOutputBuf, CallReceipt, InstantiateReceipt}; +use crate::{Schedule, Trait, CodeHash, ComputeDispatchFee, BalanceOf}; +use crate::exec::{Ext, VmExecResult, OutputBuf, EmptyOutputBuf, CallReceipt, InstantiateReceipt}; use crate::gas::{GasMeter, Token, GasMeterResult, approx_gas_for_balance}; use sandbox; use system; diff --git a/substrate/srml/support/src/traits.rs b/substrate/srml/support/src/traits.rs index 9f70f13cd6..6f0435a77a 100644 --- a/substrate/srml/support/src/traits.rs +++ b/substrate/srml/support/src/traits.rs @@ -234,11 +234,11 @@ pub trait Currency { /// The opaque token type for an imbalance. This is returned by unbalanced operations /// and must be dealt with. It may be dropped but cannot be cloned. - type PositiveImbalance: Imbalance; + type PositiveImbalance: Imbalance; /// The opaque token type for an imbalance. This is returned by unbalanced operations /// and must be dealt with. It may be dropped but cannot be cloned. - type NegativeImbalance: Imbalance; + type NegativeImbalance: Imbalance; // PUBLIC IMMUTABLES