Skip to content

Commit 34e0f63

Browse files
Deprecate pallet-currency-swap and precompile-currency-swap usage at humanode-runtime
1 parent 9199057 commit 34e0f63

File tree

8 files changed

+3
-298
lines changed

8 files changed

+3
-298
lines changed

Cargo.lock

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/humanode-runtime/Cargo.toml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ pallet-bioauth = { path = "../pallet-bioauth", default-features = false }
2323
pallet-bootnodes = { path = "../pallet-bootnodes", default-features = false }
2424
pallet-chain-properties = { path = "../pallet-chain-properties", default-features = false }
2525
pallet-chain-start-moment = { path = "../pallet-chain-start-moment", default-features = false }
26-
pallet-currency-swap = { path = "../pallet-currency-swap", default-features = false }
2726
pallet-dummy-precompiles-code = { path = "../pallet-dummy-precompiles-code", default-features = false }
2827
pallet-erc20-support = { path = "../pallet-erc20-support", default-features = false }
2928
pallet-ethereum-chain-id = { path = "../pallet-ethereum-chain-id", default-features = false }
@@ -38,7 +37,6 @@ pallet-token-claims = { path = "../pallet-token-claims", default-features = fals
3837
pallet-vesting = { path = "../pallet-vesting", default-features = false }
3938
precompile-bioauth = { path = "../precompile-bioauth", default-features = false }
4039
precompile-bls12381 = { path = "../precompile-bls12381", default-features = false }
41-
precompile-currency-swap = { path = "../precompile-currency-swap", default-features = false }
4240
precompile-evm-accounts-mapping = { path = "../precompile-evm-accounts-mapping", default-features = false }
4341
precompile-native-currency = { path = "../precompile-native-currency", default-features = false }
4442
precompile-utils = { path = "../precompile-utils", default-features = false }
@@ -124,7 +122,6 @@ runtime-benchmarks = [
124122
"pallet-balances/runtime-benchmarks",
125123
"pallet-bioauth/runtime-benchmarks",
126124
"pallet-bootnodes/runtime-benchmarks",
127-
"pallet-currency-swap/runtime-benchmarks",
128125
"pallet-ethereum/runtime-benchmarks",
129126
"pallet-evm-accounts-mapping/runtime-benchmarks",
130127
"pallet-evm-swap/runtime-benchmarks",
@@ -173,7 +170,6 @@ std = [
173170
"pallet-bootnodes/std",
174171
"pallet-chain-properties/std",
175172
"pallet-chain-start-moment/std",
176-
"pallet-currency-swap/std",
177173
"pallet-dummy-precompiles-code/std",
178174
"pallet-erc20-support/std",
179175
"pallet-ethereum-chain-id/std",
@@ -204,7 +200,6 @@ std = [
204200
"pallet-vesting/std",
205201
"precompile-bioauth/std",
206202
"precompile-bls12381/std",
207-
"precompile-currency-swap/std",
208203
"precompile-evm-accounts-mapping/std",
209204
"precompile-native-currency/std",
210205
"precompile-utils/std",
@@ -250,7 +245,6 @@ try-runtime = [
250245
"pallet-bootnodes/try-runtime",
251246
"pallet-chain-properties/try-runtime",
252247
"pallet-chain-start-moment/try-runtime",
253-
"pallet-currency-swap/try-runtime",
254248
"pallet-dummy-precompiles-code/try-runtime",
255249
"pallet-erc20-support/try-runtime",
256250
"pallet-ethereum-chain-id/try-runtime",

crates/humanode-runtime/src/currency_swap.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,6 @@ parameter_types! {
1212
pub EvmToNativeSwapBridgePotAccountId: EvmAccountId = EvmToNativeSwapBridgePot::account_id();
1313
}
1414

15-
pub type NativeToEvmOneToOne =
16-
bridge_pot_currency_swap::CurrencySwap<NativeToEvmOneToOneConfig, ExistenceRequired>;
17-
18-
pub struct NativeToEvmOneToOneConfig;
19-
20-
impl bridge_pot_currency_swap::Config for NativeToEvmOneToOneConfig {
21-
type AccountIdFrom = AccountId;
22-
type AccountIdTo = EvmAccountId;
23-
type CurrencyFrom = Balances;
24-
type CurrencyTo = EvmBalances;
25-
type BalanceConverter = Identity;
26-
type PotFrom = NativeToEvmSwapBridgePotAccountId;
27-
type PotTo = EvmToNativeSwapBridgePotAccountId;
28-
}
29-
3015
pub type EvmToNativeOneToOne =
3116
bridge_pot_currency_swap::CurrencySwap<EvmToNativeOneToOneConfig, ExistenceRequired>;
3217

crates/humanode-runtime/src/frontier_precompiles.rs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@ use precompile_bls12381::{
1313
Bls12381G1Add, Bls12381G1Mul, Bls12381G1MultiExp, Bls12381G2Add, Bls12381G2Mul,
1414
Bls12381G2MultiExp, Bls12381MapG1, Bls12381MapG2, Bls12381Pairing,
1515
};
16-
use precompile_currency_swap::CurrencySwap;
1716
use precompile_evm_accounts_mapping::EvmAccountsMapping;
1817
use precompile_native_currency::NativeCurrency;
1918
use precompile_utils::EvmData;
2019
use sp_core::{H160, U256};
2120
use sp_std::marker::PhantomData;
2221

23-
use crate::{currency_swap, AccountId, ConstU64, EvmAccountId};
22+
use crate::ConstU64;
2423

2524
/// A set of constant values used to indicate precompiles.
2625
pub mod precompiles_constants {
@@ -75,10 +74,8 @@ pub mod precompiles_constants {
7574
pub const EVM_ACCOUNTS_MAPPING: u64 = 2049;
7675
/// `NativeCurrency` precompile constant.
7776
pub const NATIVE_CURRENCY: u64 = 2050;
78-
/// `CurrencySwap` precompile constant.
79-
pub const CURRENCY_SWAP: u64 = 2304;
8077
/// `EvmSwap` precompile constant.
81-
pub const EVM_SWAP: u64 = 2305;
78+
pub const EVM_SWAP: u64 = 2304;
8279
}
8380

8481
use precompiles_constants::*;
@@ -120,7 +117,6 @@ where
120117
BIOAUTH,
121118
EVM_ACCOUNTS_MAPPING,
122119
NATIVE_CURRENCY,
123-
CURRENCY_SWAP,
124120
EVM_SWAP,
125121
]
126122
.into_iter()
@@ -180,15 +176,6 @@ where
180176
a if a == hash(NATIVE_CURRENCY) => {
181177
Some(NativeCurrency::<R, ConstU64<200>>::execute(handle))
182178
}
183-
a if a == hash(CURRENCY_SWAP) => {
184-
Some(CurrencySwap::<
185-
currency_swap::EvmToNativeOneToOne,
186-
EvmAccountId,
187-
AccountId,
188-
// TODO(#697): implement proper dynamic gas cost estimation.
189-
ConstU64<200>,
190-
>::execute(handle))
191-
}
192179
a if a == hash(EVM_SWAP) => Some(EvmSwap::<
193180
R,
194181
// TODO(#697): implement proper dynamic gas cost estimation.

crates/humanode-runtime/src/lib.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -628,13 +628,6 @@ impl pallet_evm_balances::Config for Runtime {
628628
type DustRemoval = currency_swap::TreasuryPotProxy;
629629
}
630630

631-
impl pallet_currency_swap::Config for Runtime {
632-
type RuntimeEvent = RuntimeEvent;
633-
type AccountIdTo = EvmAccountId;
634-
type CurrencySwap = currency_swap::NativeToEvmOneToOne;
635-
type WeightInfo = ();
636-
}
637-
638631
impl pallet_evm_swap::Config for Runtime {
639632
type RuntimeEvent = RuntimeEvent;
640633
type EvmAccountId = EvmAccountId;
@@ -799,7 +792,6 @@ frame_support::parameter_types! {
799792
frontier_precompiles::hash(precompiles_constants::BIOAUTH),
800793
frontier_precompiles::hash(precompiles_constants::EVM_ACCOUNTS_MAPPING),
801794
frontier_precompiles::hash(precompiles_constants::NATIVE_CURRENCY),
802-
frontier_precompiles::hash(precompiles_constants::CURRENCY_SWAP),
803795
frontier_precompiles::hash(precompiles_constants::EVM_SWAP),
804796
];
805797
}
@@ -850,7 +842,6 @@ construct_runtime!(
850842
EvmBalances: pallet_evm_balances = 32,
851843
NativeToEvmSwapBridgePot: pallet_pot::<Instance4> = 33,
852844
EvmToNativeSwapBridgePot: pallet_pot::<Instance5> = 34,
853-
CurrencySwap: pallet_currency_swap = 35,
854845
BalancedCurrencySwapBridgesInitializer: pallet_balanced_currency_swap_bridges_initializer = 36,
855846
EvmBalancesErc20Support: pallet_erc20_support = 37,
856847
DummyPrecompilesCode: pallet_dummy_precompiles_code = 38,

0 commit comments

Comments
 (0)