|
1 |
| -use std::collections::BTreeMap; |
2 |
| -use std::str::FromStr; |
3 |
| - |
4 | 1 | use clover_primitives::currency::*;
|
5 | 2 | pub use clover_primitives::{AccountId, Balance, Signature};
|
6 | 3 | pub use clover_runtime::RuntimeGenesisConfig;
|
7 | 4 | use clover_runtime::{
|
8 | 5 | wasm_binary_unwrap, BabeConfig, BalancesConfig, Block, CouncilConfig, DemocracyConfig,
|
9 |
| - EVMConfig, EthereumConfig, ImOnlineConfig, IndicesConfig, SessionConfig, SessionKeys, |
10 |
| - StakerStatus, StakingConfig, SudoConfig, SystemConfig, TechnicalCommitteeConfig, |
| 6 | + ImOnlineConfig, IndicesConfig, SessionConfig, SessionKeys, StakerStatus, StakingConfig, |
| 7 | + SudoConfig, SystemConfig, TechnicalCommitteeConfig, |
11 | 8 | };
|
12 |
| -use fp_evm::GenesisAccount; |
13 | 9 | use hex_literal::hex;
|
14 | 10 | use pallet_im_online::sr25519::AuthorityId as ImOnlineId;
|
15 | 11 | use sc_chain_spec::ChainSpecExtension;
|
16 |
| -use sc_service::{ChainType, Properties}; |
| 12 | +use sc_service::ChainType; |
17 | 13 | use sc_telemetry::TelemetryEndpoints;
|
18 | 14 | use serde::{Deserialize, Serialize};
|
19 | 15 | use serde_json::json;
|
20 | 16 | use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId;
|
21 | 17 | use sp_consensus_babe::AuthorityId as BabeId;
|
22 | 18 | use sp_consensus_grandpa::AuthorityId as GrandpaId;
|
23 | 19 | use sp_core::crypto::UncheckedInto;
|
24 |
| -use sp_core::{sr25519, Pair, Public, H160, U256}; |
| 20 | +use sp_core::{sr25519, Pair, Public}; |
25 | 21 | use sp_runtime::traits::{IdentifyAccount, Verify};
|
26 | 22 | use sp_runtime::Perbill;
|
27 | 23 | type AccountPublic = <Signature as Verify>::Signer;
|
@@ -168,7 +164,6 @@ fn staging_testnet_config_genesis() -> RuntimeGenesisConfig {
|
168 | 164 | vec![],
|
169 | 165 | root_key,
|
170 | 166 | Some(endowed_accounts),
|
171 |
| - dev_endowed_evm_accounts(), |
172 | 167 | )
|
173 | 168 | }
|
174 | 169 |
|
@@ -228,54 +223,13 @@ pub fn authority_keys_from_seed(
|
228 | 223 | )
|
229 | 224 | }
|
230 | 225 |
|
231 |
| -/// Get hard coded endowed account for EVM. |
232 |
| -fn endowed_evm_account() -> BTreeMap<H160, GenesisAccount> { |
233 |
| - let endowed_account = vec![ |
234 |
| - // clover fauct |
235 |
| - H160::from_str("9157f0316f375e4ccf67f8d21ae0881d0abcbb21").unwrap(), |
236 |
| - ]; |
237 |
| - get_endowed_evm_accounts(endowed_account) |
238 |
| -} |
239 |
| - |
240 |
| -/// Get hard coded endowed accounts for EVM. |
241 |
| -fn dev_endowed_evm_accounts() -> BTreeMap<H160, GenesisAccount> { |
242 |
| - let endowed_account = vec![ |
243 |
| - H160::from_str("6be02d1d3665660d22ff9624b7be0551ee1ac91b").unwrap(), |
244 |
| - H160::from_str("e6206C7f064c7d77C6d8e3eD8601c9AA435419cE").unwrap(), |
245 |
| - // the dev account key |
246 |
| - // seed: bottom drive obey lake curtain smoke basket hold race lonely fit walk |
247 |
| - // private key: 0x03183f27e9d78698a05c24eb6732630eb17725fcf2b53ee3a6a635d6ff139680 |
248 |
| - H160::from_str("aed40f2261ba43b4dffe484265ce82d8ffe2b4db").unwrap(), |
249 |
| - ]; |
250 |
| - |
251 |
| - get_endowed_evm_accounts(endowed_account) |
252 |
| -} |
253 |
| - |
254 |
| -/// Helper function to convert endowed accounts to EVM genesis accounts. |
255 |
| -fn get_endowed_evm_accounts(endowed_accounts: Vec<H160>) -> BTreeMap<H160, GenesisAccount> { |
256 |
| - let mut evm_accounts = BTreeMap::new(); |
257 |
| - for account in endowed_accounts { |
258 |
| - evm_accounts.insert( |
259 |
| - account, |
260 |
| - GenesisAccount { |
261 |
| - nonce: U256::from(0), |
262 |
| - balance: U256::from(1_000 * DOLLARS), |
263 |
| - storage: Default::default(), |
264 |
| - code: vec![], |
265 |
| - }, |
266 |
| - ); |
267 |
| - } |
268 |
| - evm_accounts |
269 |
| -} |
270 |
| - |
271 | 226 | /// Development testnet genesis
|
272 | 227 | fn development_config_genesis() -> RuntimeGenesisConfig {
|
273 | 228 | testnet_genesis(
|
274 | 229 | vec![authority_keys_from_seed("Alice")],
|
275 | 230 | vec![],
|
276 | 231 | get_account_id_from_seed::<sr25519::Public>("Alice"),
|
277 | 232 | None,
|
278 |
| - dev_endowed_evm_accounts(), |
279 | 233 | )
|
280 | 234 | }
|
281 | 235 |
|
@@ -327,7 +281,6 @@ fn local_testnet_genesis() -> RuntimeGenesisConfig {
|
327 | 281 | get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
|
328 | 282 | get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
|
329 | 283 | ]),
|
330 |
| - endowed_evm_account(), |
331 | 284 | )
|
332 | 285 | }
|
333 | 286 |
|
@@ -414,7 +367,6 @@ fn local_rose_testnet_genesis() -> RuntimeGenesisConfig {
|
414 | 367 | // 5CPQQYs3wf32fr5PhmmfFQEeVzD1Zy9Hdo8LFzQYuhP8XHW6
|
415 | 368 | hex!["0e42eb6f65a8ef5e3f3c3cdb5b2c3be646e791abd76e2224d5847cde786b2e01"].into(),
|
416 | 369 | ]),
|
417 |
| - endowed_evm_account(), |
418 | 370 | )
|
419 | 371 | }
|
420 | 372 |
|
@@ -518,7 +470,6 @@ fn iris_testnet_genesis() -> RuntimeGenesisConfig {
|
518 | 470 | // 5CPQQYs3wf32fr5PhmmfFQEeVzD1Zy9Hdo8LFzQYuhP8XHW6
|
519 | 471 | hex!["0e42eb6f65a8ef5e3f3c3cdb5b2c3be646e791abd76e2224d5847cde786b2e01"].into(),
|
520 | 472 | ]),
|
521 |
| - endowed_evm_account(), |
522 | 473 | )
|
523 | 474 | }
|
524 | 475 |
|
@@ -567,7 +518,6 @@ pub fn testnet_genesis(
|
567 | 518 | initial_nominators: Vec<AccountId>,
|
568 | 519 | root_key: AccountId,
|
569 | 520 | endowed_accounts: Option<Vec<AccountId>>,
|
570 |
| - endowed_eth_accounts: BTreeMap<H160, GenesisAccount>, |
571 | 521 | ) -> RuntimeGenesisConfig {
|
572 | 522 | let mut endowed_accounts: Vec<AccountId> = endowed_accounts.unwrap_or_else(|| {
|
573 | 523 | vec![
|
@@ -638,11 +588,6 @@ pub fn testnet_genesis(
|
638 | 588 | .map(|x| (x, ENDOWMENT))
|
639 | 589 | .collect(),
|
640 | 590 | },
|
641 |
| - evm: EVMConfig { |
642 |
| - accounts: endowed_eth_accounts, |
643 |
| - ..Default::default() |
644 |
| - }, |
645 |
| - ethereum: EthereumConfig::default(), |
646 | 591 | im_online: ImOnlineConfig { keys: vec![] },
|
647 | 592 | indices: IndicesConfig { indices: vec![] },
|
648 | 593 | session: SessionConfig {
|
@@ -704,7 +649,6 @@ pub(crate) mod tests {
|
704 | 649 | vec![],
|
705 | 650 | get_account_id_from_seed::<sr25519::Public>("Alice"),
|
706 | 651 | None,
|
707 |
| - dev_endowed_evm_accounts(), |
708 | 652 | )
|
709 | 653 | }
|
710 | 654 |
|
|
0 commit comments