difftreelog
CORE-300 Adapt to CrossAccountId
in: master
20 files changed
Cargo.lockdiffbeforeafterboth2554 "fc-db",2554 "fc-db",2555 "fc-rpc-core",2555 "fc-rpc-core",2556 "fp-consensus",2556 "fp-consensus",2557 "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",2557 "fp-evm",2558 "fp-rpc",2558 "fp-rpc",2559 "fp-storage",2559 "fp-storage",2560 "futures 0.3.21",2560 "futures 0.3.21",2565 "log",2565 "log",2566 "lru 0.6.6",2566 "lru 0.6.6",2567 "pallet-ethereum",2567 "pallet-ethereum",2568 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",2568 "pallet-evm",2569 "parity-scale-codec",2569 "parity-scale-codec",2570 "parking_lot 0.11.2",2570 "parking_lot 0.11.2",2571 "rand 0.7.3",2571 "rand 0.7.3",2757dependencies = [2757dependencies = [2758 "ethereum",2758 "ethereum",2759 "ethereum-types",2759 "ethereum-types",2760 "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",2760 "fp-evm",2761 "parity-scale-codec",2761 "parity-scale-codec",2762 "scale-info",2762 "scale-info",2763 "sp-api",2763 "sp-api",2852 "sp-trie",2852 "sp-trie",2853]2853]28542855[[package]]2856name = "frame-common"2857version = "0.1.0"2858source = "git+https://github.com/uniquenetwork/frontier.git?branch=feature/300#0a1dc4086cbe971ddf57edf82a61cfce52c8c20b"2859dependencies = [2860 "frame-system",2861 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=feature/300)",2862 "parity-scale-codec",2863 "scale-info",2864 "serde",2865 "sp-core",2866 "sp-std",2867 "up-evm-mapping",2868]286928542870[[package]]2855[[package]]2871name = "frame-election-provider-support"2856name = "frame-election-provider-support"5850dependencies = [5835dependencies = [5851 "frame-support",5836 "frame-support",5852 "frame-system",5837 "frame-system",5853 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",5838 "pallet-evm",5854 "parity-scale-codec",5839 "parity-scale-codec",5855 "scale-info",5840 "scale-info",5856 "serde",5841 "serde",5999version = "0.1.0"5984version = "0.1.0"6000dependencies = [5985dependencies = [6001 "evm-coder",5986 "evm-coder",6002 "frame-common",6003 "frame-support",5987 "frame-support",6004 "frame-system",5988 "frame-system",6005 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",5989 "pallet-evm",6006 "pallet-evm-coder-substrate",5990 "pallet-evm-coder-substrate",6007 "parity-scale-codec",5991 "parity-scale-codec",6008 "scale-info",5992 "scale-info",6080 "ethereum-types",6064 "ethereum-types",6081 "evm",6065 "evm",6082 "fp-consensus",6066 "fp-consensus",6083 "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",6067 "fp-evm",6084 "fp-rpc",6068 "fp-rpc",6085 "fp-self-contained",6069 "fp-self-contained",6086 "fp-storage",6070 "fp-storage",6087 "frame-support",6071 "frame-support",6088 "frame-system",6072 "frame-system",6089 "log",6073 "log",6090 "pallet-balances",6074 "pallet-balances",6091 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",6075 "pallet-evm",6092 "pallet-timestamp",6076 "pallet-timestamp",6093 "parity-scale-codec",6077 "parity-scale-codec",6094 "rlp",6078 "rlp",6109 "evm",6093 "evm",6110 "evm-gasometer",6094 "evm-gasometer",6111 "evm-runtime",6095 "evm-runtime",6112 "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",6096 "fp-evm",6113 "frame-benchmarking",6097 "frame-benchmarking",6114 "frame-support",6098 "frame-support",6115 "frame-system",6099 "frame-system",6140 "frame-support",6124 "frame-support",6141 "frame-system",6125 "frame-system",6142 "pallet-ethereum",6126 "pallet-ethereum",6143 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",6127 "pallet-evm",6144 "parity-scale-codec",6128 "parity-scale-codec",6145 "scale-info",6129 "scale-info",6146 "sp-core",6130 "sp-core",6155 "frame-support",6139 "frame-support",6156 "frame-system",6140 "frame-system",6157 "log",6141 "log",6158 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",6142 "pallet-evm",6159 "pallet-evm-coder-substrate",6143 "pallet-evm-coder-substrate",6160 "parity-scale-codec",6144 "parity-scale-codec",6161 "scale-info",6145 "scale-info",6170name = "pallet-evm-migration"6154name = "pallet-evm-migration"6171version = "0.1.0"6155version = "0.1.0"6172dependencies = [6156dependencies = [6173 "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",6157 "fp-evm",6174 "frame-benchmarking",6158 "frame-benchmarking",6175 "frame-support",6159 "frame-support",6176 "frame-system",6160 "frame-system",6177 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",6161 "pallet-evm",6178 "parity-scale-codec",6162 "parity-scale-codec",6179 "scale-info",6163 "scale-info",6180 "sp-core",6164 "sp-core",6187name = "pallet-evm-transaction-payment"6171name = "pallet-evm-transaction-payment"6188version = "0.1.0"6172version = "0.1.0"6189dependencies = [6173dependencies = [6190 "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",6174 "fp-evm",6191 "frame-support",6175 "frame-support",6192 "frame-system",6176 "frame-system",6193 "pallet-ethereum",6177 "pallet-ethereum",6194 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",6178 "pallet-evm",6195 "parity-scale-codec",6179 "parity-scale-codec",6196 "scale-info",6180 "scale-info",6197 "sp-core",6181 "sp-core",6209 "ethereum",6193 "ethereum",6210 "evm-coder",6194 "evm-coder",6211 "frame-benchmarking",6195 "frame-benchmarking",6212 "frame-common",6213 "frame-support",6196 "frame-support",6214 "frame-system",6197 "frame-system",6215 "pallet-common",6198 "pallet-common",6199 "pallet-evm",6216 "pallet-evm-coder-substrate",6200 "pallet-evm-coder-substrate",6217 "parity-scale-codec",6201 "parity-scale-codec",6218 "scale-info",6202 "scale-info",6436 "ethereum",6420 "ethereum",6437 "evm-coder",6421 "evm-coder",6438 "frame-benchmarking",6422 "frame-benchmarking",6439 "frame-common",6440 "frame-support",6423 "frame-support",6441 "frame-system",6424 "frame-system",6442 "pallet-common",6425 "pallet-common",6426 "pallet-evm",6443 "pallet-evm-coder-substrate",6427 "pallet-evm-coder-substrate",6444 "parity-scale-codec",6428 "parity-scale-codec",6445 "scale-info",6429 "scale-info",6553version = "0.1.0"6537version = "0.1.0"6554dependencies = [6538dependencies = [6555 "frame-benchmarking",6539 "frame-benchmarking",6556 "frame-common",6557 "frame-support",6540 "frame-support",6558 "frame-system",6541 "frame-system",6559 "pallet-common",6542 "pallet-common",6543 "pallet-evm",6560 "parity-scale-codec",6544 "parity-scale-codec",6561 "scale-info",6545 "scale-info",6562 "sp-core",6546 "sp-core",6814dependencies = [6798dependencies = [6815 "ethereum",6799 "ethereum",6816 "evm-coder",6800 "evm-coder",6817 "fp-evm 3.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",6801 "fp-evm",6818 "frame-benchmarking",6802 "frame-benchmarking",6819 "frame-common",6820 "frame-support",6803 "frame-support",6821 "frame-system",6804 "frame-system",6822 "hex-literal",6805 "hex-literal",6823 "pallet-balances",6806 "pallet-balances",6824 "pallet-common",6807 "pallet-common",6825 "pallet-ethereum",6808 "pallet-ethereum",6826 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",6809 "pallet-evm",6827 "pallet-evm-coder-substrate",6810 "pallet-evm-coder-substrate",6828 "pallet-fungible",6811 "pallet-fungible",6829 "pallet-nonfungible",6812 "pallet-nonfungible",12353name = "uc-rpc"12336name = "uc-rpc"12354version = "0.1.0"12337version = "0.1.0"12355dependencies = [12338dependencies = [12356 "frame-common",12357 "jsonrpc-core",12339 "jsonrpc-core",12358 "jsonrpc-core-client",12340 "jsonrpc-core-client",12359 "jsonrpc-derive",12341 "jsonrpc-derive",12360 "pallet-common",12342 "pallet-common",12343 "pallet-evm",12361 "parity-scale-codec",12344 "parity-scale-codec",12362 "sp-api",12345 "sp-api",12363 "sp-blockchain",12346 "sp-blockchain",12570 "fp-rpc",12553 "fp-rpc",12571 "fp-self-contained",12554 "fp-self-contained",12572 "frame-benchmarking",12555 "frame-benchmarking",12573 "frame-common",12574 "frame-executive",12556 "frame-executive",12575 "frame-support",12557 "frame-support",12576 "frame-system",12558 "frame-system",12583 "pallet-base-fee",12565 "pallet-base-fee",12584 "pallet-common",12566 "pallet-common",12585 "pallet-ethereum",12567 "pallet-ethereum",12586 "pallet-evm 6.0.0-dev (git+https://github.com/uniquenetwork/frontier.git?branch=unique-polkadot-v0.9.17)",12568 "pallet-evm",12587 "pallet-evm-coder-substrate",12569 "pallet-evm-coder-substrate",12588 "pallet-evm-contract-helpers",12570 "pallet-evm-contract-helpers",12589 "pallet-evm-migration",12571 "pallet-evm-migration",12720name = "up-rpc"12702name = "up-rpc"12721version = "0.1.0"12703version = "0.1.0"12722dependencies = [12704dependencies = [12723 "frame-common",12724 "pallet-common",12705 "pallet-common",12706 "pallet-evm",12725 "parity-scale-codec",12707 "parity-scale-codec",12726 "sp-api",12708 "sp-api",12727 "sp-core",12709 "sp-core",client/rpc/Cargo.tomldiffbeforeafterboth--- a/client/rpc/Cargo.toml
+++ b/client/rpc/Cargo.toml
@@ -18,4 +18,5 @@
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18" }
sp-rpc = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18" }
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18" }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.18" }
frame-common = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "feature/300" }
client/rpc/src/lib.rsdiffbeforeafterboth--- a/client/rpc/src/lib.rs
+++ b/client/rpc/src/lib.rs
@@ -201,7 +201,7 @@
AccountId: Decode,
C: 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block>,
C::Api: UniqueRuntimeApi<Block, CrossAccountId, AccountId>,
- CrossAccountId: frame_common::account::CrossAccountId<AccountId>,
+ CrossAccountId: pallet_evm::account::CrossAccountId<AccountId>,
{
pass_method!(account_tokens(collection: CollectionId, account: CrossAccountId) -> Vec<TokenId>);
pass_method!(token_exists(collection: CollectionId, token: TokenId) -> bool);
pallets/common/src/lib.rsdiffbeforeafterboth--- a/pallets/common/src/lib.rs
+++ b/pallets/common/src/lib.rs
@@ -19,7 +19,7 @@
use core::ops::{Deref, DerefMut};
use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder};
use sp_std::vec::Vec;
-use frame_common::account::CrossAccountId;
+use pallet_evm::account::CrossAccountId;
use frame_support::{
dispatch::{DispatchErrorWithPostInfo, DispatchResultWithPostInfo},
ensure, fail,
@@ -162,19 +162,14 @@
pub mod pallet {
use super::*;
use frame_support::{Blake2_128Concat, pallet_prelude::*, storage::Key};
- use frame_common::account::CrossAccountId;
+ use pallet_evm::account;
use frame_support::traits::Currency;
use up_data_structs::TokenId;
use scale_info::TypeInfo;
#[pallet::config]
- pub trait Config: frame_system::Config + pallet_evm_coder_substrate::Config + TypeInfo {
+ pub trait Config: frame_system::Config + pallet_evm_coder_substrate::Config + TypeInfo + account::Config {
type Event: IsType<<Self as frame_system::Config>::Event> + From<Event<Self>>;
-
- type CrossAccountId: CrossAccountId<Self::AccountId>;
-
- type EvmAddressMapping: pallet_evm::AddressMapping<Self::AccountId>;
- type EvmBackwardsAddressMapping: up_evm_mapping::EvmBackwardsAddressMapping<Self::AccountId>;
type Currency: Currency<Self::AccountId>;
pallets/evm-transaction-payment/src/lib.rsdiffbeforeafterboth--- a/pallets/evm-transaction-payment/src/lib.rs
+++ b/pallets/evm-transaction-payment/src/lib.rs
@@ -20,7 +20,7 @@
use fp_evm::WithdrawReason;
use frame_support::traits::{Currency, IsSubType};
pub use pallet::*;
-use pallet_evm::{EVMCurrencyAdapter, EnsureAddressOrigin};
+use pallet_evm::{EVMCurrencyAdapter, EnsureAddressOrigin, account::CrossAccountId};
use sp_core::{H160, U256};
use sp_runtime::TransactionOutcome;
use up_sponsorship::SponsorshipHandler;
@@ -35,11 +35,9 @@
use sp_std::vec::Vec;
#[pallet::config]
- pub trait Config: frame_system::Config {
+ pub trait Config: frame_system::Config + pallet_evm::account::Config {
type EvmSponsorshipHandler: SponsorshipHandler<Self::AccountId, (H160, Vec<u8>)>;
type Currency: Currency<Self::AccountId>;
- type EvmBackwardsAddressMapping: EvmBackwardsAddressMapping<Self::AccountId>;
- type EvmAddressMapping: AddressMapping<Self::AccountId>;
}
#[pallet::pallet]
@@ -86,14 +84,16 @@
type LiquidityInfo = Option<ChargeEvmLiquidityInfo<T>>;
fn withdraw_fee(
- who: &T::AccountId,
+ who: &T::CrossAccountId,
reason: WithdrawReason,
fee: U256,
) -> core::result::Result<Self::LiquidityInfo, pallet_evm::Error<T>> {
- let mut who_pays_fee = who.clone();
+ let who_pays_fee;
if let WithdrawReason::Call { target, input } = &reason {
- who_pays_fee = T::EvmSponsorshipHandler::get_sponsor(who, &(*target, input.clone()))
- .unwrap_or(who_pays_fee);
+ who_pays_fee = <T as pallet_evm::account::Config>::CrossAccountId::from_sub(T::EvmSponsorshipHandler::get_sponsor(&who.as_sub(), &(*target, input.clone()))
+ .unwrap_or(who.as_sub().clone()));
+ } else {
+ who_pays_fee = who.clone();
}
let negative_imbalance = EVMCurrencyAdapter::<<T as Config>::Currency, ()>::withdraw_fee(
@@ -102,20 +102,19 @@
fee,
)?;
- let who_pays_fee_eth = T::EvmBackwardsAddressMapping::from_account_id(who_pays_fee);
Ok(negative_imbalance.map(|i| ChargeEvmLiquidityInfo {
- who: who_pays_fee_eth,
+ who: who_pays_fee.as_eth().clone(),
negative_imbalance: i,
}))
}
fn correct_and_deposit_fee(
- who: &T::AccountId,
+ who: &T::CrossAccountId,
corrected_fee: U256,
already_withdrawn: Self::LiquidityInfo,
) {
<EVMCurrencyAdapter<<T as Config>::Currency, ()> as pallet_evm::OnChargeEVMTransaction<T>>::correct_and_deposit_fee(
- &already_withdrawn.as_ref().map(|e| T::EvmAddressMapping::into_account_id(e.who)).unwrap_or(who.clone()),
+ &already_withdrawn.as_ref().map(|e| T::CrossAccountId::from_eth(e.who)).unwrap_or(who.clone()),
corrected_fee,
already_withdrawn.map(|e| e.negative_imbalance),
)
pallets/fungible/Cargo.tomldiffbeforeafterboth--- a/pallets/fungible/Cargo.toml
+++ b/pallets/fungible/Cargo.toml
@@ -22,10 +22,10 @@
pallet-evm-coder-substrate = { default-features = false, path = '../evm-coder-substrate' }
ethereum = { version = "0.12.0", default-features = false }
frame-benchmarking = { default-features = false, optional = true, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.18' }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.18" }
scale-info = { version = "2.0.1", default-features = false, features = [
"derive",
] }
-frame-common = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "feature/300" }
[features]
default = ["std"]
@@ -40,5 +40,6 @@
"ethereum/std",
"pallet-evm-coder-substrate/std",
'frame-benchmarking/std',
+ "pallet-evm/std"
]
runtime-benchmarks = ['frame-benchmarking', 'pallet-common/runtime-benchmarks']
pallets/fungible/src/erc.rsdiffbeforeafterboth--- a/pallets/fungible/src/erc.rs
+++ b/pallets/fungible/src/erc.rs
@@ -21,7 +21,7 @@
use pallet_common::erc::{CommonEvmHandler, PrecompileResult};
use sp_core::{H160, U256};
use sp_std::vec::Vec;
-use frame_common::account::CrossAccountId;
+use pallet_evm::account::CrossAccountId;
use pallet_evm_coder_substrate::{call, dispatch_to_evm};
use crate::{
pallets/fungible/src/lib.rsdiffbeforeafterboth--- a/pallets/fungible/src/lib.rs
+++ b/pallets/fungible/src/lib.rs
@@ -22,7 +22,7 @@
use pallet_common::{
Error as CommonError, Event as CommonEvent, Pallet as PalletCommon,
};
-use frame_common::account::CrossAccountId;
+use pallet_evm::account::CrossAccountId;
use pallet_evm_coder_substrate::WithRecorder;
use sp_core::H160;
use sp_runtime::{ArithmeticError, DispatchError, DispatchResult};
@@ -37,7 +37,7 @@
pub mod erc;
pub mod weights;
-pub type CreateItemData<T> = (<T as pallet_common::Config>::CrossAccountId, u128);
+pub type CreateItemData<T> = (<T as pallet_evm::account::Config>::CrossAccountId, u128);
pub(crate) type SelfWeightOf<T> = <T as Config>::WeightInfo;
#[frame_support::pallet]
pallets/nonfungible/Cargo.tomldiffbeforeafterboth--- a/pallets/nonfungible/Cargo.toml
+++ b/pallets/nonfungible/Cargo.toml
@@ -16,6 +16,7 @@
sp-runtime = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.18' }
sp-std = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.18' }
sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.18' }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.18" }
pallet-common = { default-features = false, path = '../common' }
up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
evm-coder = { default-features = false, path = '../../crates/evm-coder' }
@@ -25,7 +26,6 @@
scale-info = { version = "2.0.1", default-features = false, features = [
"derive",
] }
-frame-common = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "feature/300" }
[features]
default = ["std"]
@@ -40,6 +40,7 @@
"ethereum/std",
"pallet-evm-coder-substrate/std",
'frame-benchmarking/std',
+ "pallet-evm/std"
]
runtime-benchmarks = [
'frame-benchmarking',
pallets/nonfungible/src/erc.rsdiffbeforeafterboth--- a/pallets/nonfungible/src/erc.rs
+++ b/pallets/nonfungible/src/erc.rs
@@ -27,7 +27,7 @@
use pallet_common::{
erc::{CommonEvmHandler, PrecompileResult},
};
-use frame_common::account::CrossAccountId;
+use pallet_evm::account::CrossAccountId;
use pallet_evm_coder_substrate::call;
use crate::{
pallets/nonfungible/src/lib.rsdiffbeforeafterboth--- a/pallets/nonfungible/src/lib.rs
+++ b/pallets/nonfungible/src/lib.rs
@@ -24,7 +24,7 @@
use pallet_common::{
Error as CommonError, Pallet as PalletCommon, Event as CommonEvent,
};
-use frame_common::account::CrossAccountId;
+use pallet_evm::account::CrossAccountId;
use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder};
use sp_core::H160;
use sp_runtime::{ArithmeticError, DispatchError, DispatchResult};
@@ -41,7 +41,7 @@
pub mod erc;
pub mod weights;
-pub type CreateItemData<T> = CreateNftExData<<T as pallet_common::Config>::CrossAccountId>;
+pub type CreateItemData<T> = CreateNftExData<<T as pallet_evm::account::Config>::CrossAccountId>;
pub(crate) type SelfWeightOf<T> = <T as Config>::WeightInfo;
#[derive(Encode, Decode, TypeInfo, MaxEncodedLen)]
pallets/refungible/Cargo.tomldiffbeforeafterboth--- a/pallets/refungible/Cargo.toml
+++ b/pallets/refungible/Cargo.toml
@@ -16,13 +16,13 @@
sp-runtime = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.18' }
sp-std = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.18' }
sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.18' }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.18" }
pallet-common = { default-features = false, path = '../common' }
up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
frame-benchmarking = { default-features = false, optional = true, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.18' }
scale-info = { version = "2.0.1", default-features = false, features = [
"derive",
] }
-frame-common = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "feature/300" }
[features]
default = ["std"]
@@ -34,6 +34,7 @@
"up-data-structs/std",
"pallet-common/std",
'frame-benchmarking/std',
+ "pallet-evm/std",
]
runtime-benchmarks = [
'frame-benchmarking',
pallets/refungible/src/lib.rsdiffbeforeafterboth--- a/pallets/refungible/src/lib.rs
+++ b/pallets/refungible/src/lib.rs
@@ -24,7 +24,7 @@
use pallet_common::{
Error as CommonError, Event as CommonEvent, Pallet as PalletCommon,
};
-use frame_common::account::CrossAccountId;
+use pallet_evm::account::CrossAccountId;
use sp_runtime::{ArithmeticError, DispatchError, DispatchResult};
use sp_std::{vec::Vec, vec, collections::btree_map::BTreeMap};
use core::ops::Deref;
pallets/unique/Cargo.tomldiffbeforeafterboth--- a/pallets/unique/Cargo.toml
+++ b/pallets/unique/Cargo.toml
@@ -133,7 +133,6 @@
up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/UniqueNetwork/pallet-sponsoring", branch = 'polkadot-v0.9.18' }
up-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "feature/300" }
-frame-common = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "feature/300" }
evm-coder = { default-features = false, path = "../../crates/evm-coder" }
pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }
primitive-types = { version = "0.11.1", default-features = false, features = [
pallets/unique/src/eth/sponsoring.rsdiffbeforeafterboth--- a/pallets/unique/src/eth/sponsoring.rs
+++ b/pallets/unique/src/eth/sponsoring.rs
@@ -25,7 +25,7 @@
use core::marker::PhantomData;
use core::convert::TryInto;
use up_data_structs::TokenId;
-use frame_common::account::CrossAccountId;
+use pallet_evm::account::CrossAccountId;
use pallet_nonfungible::erc::{UniqueNFTCall, ERC721UniqueExtensionsCall, ERC721Call};
use pallet_fungible::erc::{UniqueFungibleCall, ERC20Call};
pallets/unique/src/lib.rsdiffbeforeafterboth--- a/pallets/unique/src/lib.rs
+++ b/pallets/unique/src/lib.rs
@@ -57,7 +57,7 @@
CollectionHandle, Pallet as PalletCommon, Error as CommonError,
CommonWeightInfo,
};
-use frame_common::account::CrossAccountId;
+use pallet_evm::account::CrossAccountId;
use pallet_refungible::{Pallet as PalletRefungible, RefungibleHandle};
use pallet_fungible::{Pallet as PalletFungible, FungibleHandle};
use pallet_nonfungible::{Pallet as PalletNonfungible, NonfungibleHandle};
@@ -117,7 +117,7 @@
pub enum Event<T>
where
<T as frame_system::Config>::AccountId,
- <T as pallet_common::Config>::CrossAccountId,
+ <T as pallet_evm::account::Config>::CrossAccountId,
{
/// Collection sponsor was removed
///
pallets/unique/src/mock.rsdiffbeforeafterboth--- a/pallets/unique/src/mock.rs
+++ b/pallets/unique/src/mock.rs
@@ -27,7 +27,7 @@
use frame_system as system;
use pallet_evm::{AddressMapping, runner::stack::MaybeMirroredLog};
use up_evm_mapping::EvmBackwardsAddressMapping;
-use frame_common::account::CrossAccountId;
+use pallet_evm::account::CrossAccountId;
use codec::{Encode, Decode, MaxEncodedLen};
use scale_info::TypeInfo;
use up_data_structs::ConstU32;
@@ -192,15 +192,17 @@
impl pallet_common::Config for Test {
type Event = ();
- type EvmBackwardsAddressMapping = TestEvmBackwardsAddressMapping;
- type EvmAddressMapping = TestEvmAddressMapping;
- type CrossAccountId = TestCrossAccountId;
-
type Currency = Balances;
type CollectionCreationPrice = CollectionCreationPrice;
type TreasuryAccountId = TreasuryAccountId;
}
+impl pallet_evm::account::Config for Test {
+ type CrossAccountId = TestCrossAccountId;
+ type EvmAddressMapping = TestEvmAddressMapping;
+ type EvmBackwardsAddressMapping = TestEvmBackwardsAddressMapping;
+}
+
impl pallet_fungible::Config for Test {
type WeightInfo = ();
}
pallets/unique/src/sponsorship.rsdiffbeforeafterboth--- a/pallets/unique/src/sponsorship.rs
+++ b/pallets/unique/src/sponsorship.rs
@@ -30,7 +30,7 @@
NFT_SPONSOR_TRANSFER_TIMEOUT, REFUNGIBLE_SPONSOR_TRANSFER_TIMEOUT, TokenId,
};
use pallet_common::{CollectionHandle};
-use frame_common::account::CrossAccountId;
+use pallet_evm::account::CrossAccountId;
pub fn withdraw_transfer<T: Config>(
collection: &CollectionHandle<T>,
primitives/rpc/src/lib.rsdiffbeforeafterboth--- a/primitives/rpc/src/lib.rs
+++ b/primitives/rpc/src/lib.rs
@@ -28,7 +28,7 @@
#[api_version(2)]
pub trait UniqueApi<CrossAccountId, AccountId> where
AccountId: Decode,
- CrossAccountId: frame_common::account::CrossAccountId<AccountId>,
+ CrossAccountId: pallet_evm::account::CrossAccountId<AccountId>,
{
#[changed_in(2)]
fn token_owner(collection: CollectionId, token: TokenId) -> Result<CrossAccountId>;
runtime/opal/src/lib.rsdiffbeforeafterboth--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -127,6 +127,22 @@
}
}
+/// The type for looking up accounts. We don't expect more than 4 billion of them, but you
+/// never know...
+pub type AccountIndex = u32;
+
+/// Balance of an account.
+pub type Balance = u128;
+
+/// Index of a transaction in the chain.
+pub type Index = u32;
+
+/// A hash of some data used by the chain.
+pub type Hash = sp_core::H256;
+
+/// Digest item type.
+pub type DigestItem = generic::DigestItem;
+
/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know
/// the specifics of the runtime. They can then be made to be agnostic over specific formats
/// of data like extrinsics, allowing for them to continue syncing the network through upgrades
@@ -256,6 +272,12 @@
}
}
+impl pallet_evm::account::Config for Runtime {
+ type CrossAccountId = pallet_evm::account::BasicCrossAccountId<Self>;
+ type EvmAddressMapping = pallet_evm::HashedAddressMapping<Self::Hashing>;
+ type EvmBackwardsAddressMapping = up_evm_mapping::MapBackwardsAddressTruncated;
+}
+
impl pallet_evm::Config for Runtime {
type BlockGasLimit = BlockGasLimit;
type FeeCalculator = FixedFee;
@@ -283,11 +305,6 @@
impl pallet_evm_migration::Config for Runtime {
type WeightInfo = pallet_evm_migration::weights::SubstrateWeight<Self>;
-}
-
-impl frame_common::account::Config for Runtime {
- type EvmAddressMapping = pallet_evm::HashedAddressMapping<Self::Hashing>;
- type EvmBackwardsAddressMapping = up_evm_mapping::MapBackwardsAddressTruncated;
}
pub struct EthereumFindAuthor<F>(core::marker::PhantomData<F>);
@@ -848,10 +865,6 @@
impl pallet_common::Config for Runtime {
type Event = Event;
- type EvmBackwardsAddressMapping = up_evm_mapping::MapBackwardsAddressTruncated;
- type EvmAddressMapping = HashedAddressMapping<Self::Hashing>;
- type CrossAccountId = frame_common::account::BasicCrossAccountId<Self>;
-
type Currency = Balances;
type CollectionCreationPrice = CollectionCreationPrice;
type TreasuryAccountId = TreasuryAccountId;
@@ -915,8 +928,6 @@
impl pallet_evm_transaction_payment::Config for Runtime {
type EvmSponsorshipHandler = EvmSponsorshipHandler;
type Currency = Balances;
- type EvmAddressMapping = HashedAddressMapping<Self::Hashing>;
- type EvmBackwardsAddressMapping = up_evm_mapping::MapBackwardsAddressTruncated;
}
impl pallet_charge_transaction::Config for Runtime {