Skip to content

Commit 31e9786

Browse files
committed
evm: Config chain id via const parameter
1 parent 43aacf4 commit 31e9786

File tree

5 files changed

+7
-26
lines changed

5 files changed

+7
-26
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ pallet-base-fee = { git = "https://github.com/kvinwang/frontier", branch = "polk
121121
pallet-dynamic-fee = { git = "https://github.com/kvinwang/frontier", branch = "polkadot-v1.5.0", default-features = false }
122122
pallet-ethereum = { git = "https://github.com/kvinwang/frontier", branch = "polkadot-v1.5.0", default-features = false }
123123
pallet-evm = { git = "https://github.com/kvinwang/frontier", branch = "polkadot-v1.5.0", default-features = false }
124-
pallet-evm-chain-id = { git = "https://github.com/kvinwang/frontier", branch = "polkadot-v1.5.0", default-features = false }
125124
pallet-evm-precompile-modexp = { git = "https://github.com/kvinwang/frontier", branch = "polkadot-v1.5.0", default-features = false }
126125
pallet-evm-precompile-sha3fips = { git = "https://github.com/kvinwang/frontier", branch = "polkadot-v1.5.0", default-features = false }
127126
pallet-evm-precompile-simple = { git = "https://github.com/kvinwang/frontier", branch = "polkadot-v1.5.0", default-features = false }

standalone/node/src/chain_spec.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ use node_runtime::constants::{currency::*, time::*};
2424
use node_runtime::Block;
2525
use node_runtime::{
2626
wasm_binary_unwrap, AssetsConfig, BabeConfig, BalancesConfig, BaseFeeConfig, CouncilConfig,
27-
DemocracyConfig, DynamicFeeConfig, EVMChainIdConfig, ElectionsConfig, ImOnlineConfig,
28-
IndicesConfig, NominationPoolsConfig, PhalaRegistryConfig, SessionConfig, SessionKeys,
29-
SocietyConfig, StakerStatus, StakingConfig, SudoConfig, SystemConfig, TechnicalCommitteeConfig,
27+
DemocracyConfig, DynamicFeeConfig, ElectionsConfig, ImOnlineConfig, IndicesConfig,
28+
NominationPoolsConfig, PhalaRegistryConfig, SessionConfig, SessionKeys, SocietyConfig,
29+
StakerStatus, StakingConfig, SudoConfig, SystemConfig, TechnicalCommitteeConfig,
3030
};
3131
use pallet_im_online::sr25519::AuthorityId as ImOnlineId;
3232
use sc_chain_spec::{ChainSpecExtension, Properties};
@@ -526,10 +526,6 @@ pub fn testnet_genesis(
526526
dynamic_fee: DynamicFeeConfig::default(),
527527
ethereum: Default::default(),
528528
evm: Default::default(),
529-
evm_chain_id: EVMChainIdConfig {
530-
chain_id: 1234567, // TODO: We need to register a chain id
531-
..Default::default()
532-
},
533529
}
534530
}
535531

standalone/runtime/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ pallet-base-fee = { workspace = true }
122122
pallet-dynamic-fee = { workspace = true }
123123
pallet-ethereum = { workspace = true }
124124
pallet-evm = { workspace = true }
125-
pallet-evm-chain-id = { workspace = true }
126125
pallet-evm-precompile-modexp = { workspace = true }
127126
pallet-evm-precompile-sha3fips = { workspace = true }
128127
pallet-evm-precompile-simple = { workspace = true }
@@ -221,7 +220,6 @@ std = [
221220
"pallet-dynamic-fee/std",
222221
"pallet-ethereum/std",
223222
"pallet-evm/std",
224-
"pallet-evm-chain-id/std",
225223
"pallet-evm-precompile-modexp/std",
226224
"pallet-evm-precompile-sha3fips/std",
227225
"pallet-evm-precompile-simple/std",

standalone/runtime/src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,8 +1593,6 @@ impl pallet_evm_account_mapping::Config for Runtime {
15931593
type WeightInfo = pallet_evm_account_mapping::weights::SubstrateWeight<Runtime>;
15941594
}
15951595

1596-
impl pallet_evm_chain_id::Config for Runtime {}
1597-
15981596
pub struct FindAuthorTruncated;
15991597
impl FindAuthor<H160> for FindAuthorTruncated {
16001598
fn find_author<'a, I>(_digests: I) -> Option<H160>
@@ -1652,6 +1650,10 @@ impl pallet_evm::AddressMapping<AccountId> for PostfixAddressMapping {
16521650
}
16531651
}
16541652

1653+
parameter_types! {
1654+
pub const EVMChainId: u64 = 2035;
1655+
}
1656+
16551657
impl pallet_evm::Config for Runtime {
16561658
type FeeCalculator = BaseFee;
16571659
type GasWeightMapping = pallet_evm::FixedGasWeightMapping<Self>;
@@ -1796,7 +1798,6 @@ construct_runtime!(
17961798
// Frontier
17971799
Ethereum: pallet_ethereum,
17981800
EVM: pallet_evm,
1799-
EVMChainId: pallet_evm_chain_id,
18001801
DynamicFee: pallet_dynamic_fee,
18011802
BaseFee: pallet_base_fee,
18021803
HotfixSufficients: pallet_hotfix_sufficients,

0 commit comments

Comments
 (0)