diff --git a/Cargo.lock b/Cargo.lock index 2aee3e7008..66ecd4e66f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8887,8 +8887,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e80275f23b4e7ba8f54dec5f90f016530e7307d2ee9445f617ab986cbe97f31e" +source = "git+https://github.com/darwinia-network/substrate?branch=main#1d7f6e12c651d776fc0dc1adefd007bb60f60b63" dependencies = [ "proc-macro2", "quote", @@ -8898,7 +8897,8 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "3.0.0" -source = "git+https://github.com/darwinia-network/substrate?branch=main#1d7f6e12c651d776fc0dc1adefd007bb60f60b63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e80275f23b4e7ba8f54dec5f90f016530e7307d2ee9445f617ab986cbe97f31e" dependencies = [ "proc-macro2", "quote", diff --git a/bin/node/runtime/pangolin/src/pallets/evm_.rs b/bin/node/runtime/pangolin/src/pallets/evm_.rs index 0103d6941c..708f44aa05 100644 --- a/bin/node/runtime/pangolin/src/pallets/evm_.rs +++ b/bin/node/runtime/pangolin/src/pallets/evm_.rs @@ -82,8 +82,6 @@ impl Config for Runtime { type AddressMapping = ConcatAddressMapping; type FindAuthor = EthereumFindAuthor; type BlockHashMapping = EthereumBlockHashMapping; - type RingCurrency = Ring; - type KtonCurrency = Kton; type Event = Event; type Precompiles = PangolinPrecompiles; type ChainId = ChainId; diff --git a/frame/bridge/s2s/issuing/src/tests.rs b/frame/bridge/s2s/issuing/src/tests.rs index ae4a674415..1a9608b98c 100644 --- a/frame/bridge/s2s/issuing/src/tests.rs +++ b/frame/bridge/s2s/issuing/src/tests.rs @@ -138,8 +138,6 @@ impl darwinia_evm::Config for Test { type GasWeightMapping = (); type CallOrigin = EnsureAddressTruncated; type AddressMapping = HashedAddressMapping; - type RingCurrency = Ring; - type KtonCurrency = Kton; type Event = (); type Precompiles = (); type FindAuthor = (); diff --git a/frame/dvm/src/mock.rs b/frame/dvm/src/mock.rs index d2c57a76f4..188ad354f1 100644 --- a/frame/dvm/src/mock.rs +++ b/frame/dvm/src/mock.rs @@ -187,8 +187,6 @@ impl darwinia_evm::Config for Test { type GasWeightMapping = (); type CallOrigin = EnsureAddressTruncated; type AddressMapping = HashedAddressMapping; - type RingCurrency = Ring; - type KtonCurrency = Kton; type Event = (); type Precompiles = MockPrecompiles; type ChainId = ChainId; diff --git a/frame/dvm/src/tests.rs b/frame/dvm/src/tests.rs index 5ae89e9f61..b8e40bb3ec 100644 --- a/frame/dvm/src/tests.rs +++ b/frame/dvm/src/tests.rs @@ -220,10 +220,7 @@ macro_rules! assert_balance { ::RingAccountBasic::account_basic(&$evm_address).balance, $balance ); - assert_eq!( - ::RingCurrency::free_balance(&account_id), - $left - ); + assert_eq!(Ring::free_balance(&account_id), $left); assert_eq!( >::remaining_balance(&account_id), $right diff --git a/frame/evm/src/lib.rs b/frame/evm/src/lib.rs index f21676e3da..5a8c432fc5 100644 --- a/frame/evm/src/lib.rs +++ b/frame/evm/src/lib.rs @@ -42,7 +42,7 @@ use evm::{Config as EvmConfig, ExitError, ExitReason}; use serde::{Deserialize, Serialize}; // --- paritytech --- use frame_support::{ - traits::{Currency, FindAuthor}, + traits::FindAuthor, weights::{PostDispatchInfo, Weight}, }; use frame_system::RawOrigin; @@ -86,11 +86,7 @@ pub mod pallet { /// Find author for the current block. type FindAuthor: FindAuthor; - /// Ring Currency type - type RingCurrency: Currency; - /// Kton Currency type - type KtonCurrency: Currency; - /// The account basic mapping way + /// Account basic type RingAccountBasic: AccountBasic; type KtonAccountBasic: AccountBasic; diff --git a/frame/evm/src/tests.rs b/frame/evm/src/tests.rs index 9427153dda..63fe08ad76 100644 --- a/frame/evm/src/tests.rs +++ b/frame/evm/src/tests.rs @@ -121,30 +121,11 @@ impl FindAuthor for FindAuthorTruncated { pub struct RawAccountBasic(sp_std::marker::PhantomData); impl AccountBasic for RawAccountBasic { /// Get the account basic in EVM format. - fn account_basic(address: &H160) -> Account { - let account_id = T::AddressMapping::into_account_id(*address); - - let nonce = >::account_nonce(&account_id); - let balance = T::RingCurrency::free_balance(&account_id); - - Account { - nonce: U256::from(UniqueSaturatedInto::::unique_saturated_into(nonce)), - balance: U256::from(UniqueSaturatedInto::::unique_saturated_into(balance)), - } + fn account_basic(_address: &H160) -> Account { + Account::default() } - fn mutate_account_basic_balance(address: &H160, new_balance: U256) { - let account_id = T::AddressMapping::into_account_id(*address); - let current = T::RingAccountBasic::account_basic(address); - - if current.balance > new_balance { - let diff = current.balance - new_balance; - T::RingCurrency::slash(&account_id, diff.low_u128().unique_saturated_into()); - } else if current.balance < new_balance { - let diff = new_balance - current.balance; - T::RingCurrency::deposit_creating(&account_id, diff.low_u128().unique_saturated_into()); - } - } + fn mutate_account_basic_balance(_address: &H160, _new_balance: U256) {} fn transfer(_source: &H160, _target: &H160, _value: U256) -> Result<(), ExitError> { Ok(()) @@ -176,14 +157,9 @@ impl Config for Test { type FeeCalculator = FixedGasPrice; type GasWeightMapping = (); type CallOrigin = EnsureAddressRoot; - type AddressMapping = ConcatAddressMapping; type BlockHashMapping = SubstrateBlockHashMapping; type FindAuthor = FindAuthorTruncated; - - type RingCurrency = Ring; - type KtonCurrency = Kton; - type Event = Event; type Precompiles = (); type ChainId = ();