Skip to content

Commit

Permalink
NOT Working Tony's test
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrylavrenov committed Dec 21, 2024
1 parent 318aeab commit fa58615
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
24 changes: 22 additions & 2 deletions crates/humanode-peer/src/chain_spec.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//! Provides the [`ChainSpec`] portion of the config.
use std::{collections::BTreeMap, str::FromStr};

Check failure on line 3 in crates/humanode-peer/src/chain_spec.rs

View workflow job for this annotation

GitHub Actions / Ubuntu 22.04 / clippy

unused import: `collections::BTreeMap`

Check warning on line 3 in crates/humanode-peer/src/chain_spec.rs

View workflow job for this annotation

GitHub Actions / Ubuntu 22.04 / test

unused import: `collections::BTreeMap`

Check warning on line 3 in crates/humanode-peer/src/chain_spec.rs

View workflow job for this annotation

GitHub Actions / Ubuntu 22.04 / build

unused import: `collections::BTreeMap`

Check warning on line 3 in crates/humanode-peer/src/chain_spec.rs

View workflow job for this annotation

GitHub Actions / Ubuntu 22.04 / test benchmark

unused import: `collections::BTreeMap`

Check warning on line 3 in crates/humanode-peer/src/chain_spec.rs

View workflow job for this annotation

GitHub Actions / Ubuntu 22.04 / test-run pallet benchmarks

unused import: `collections::BTreeMap`

Check warning on line 3 in crates/humanode-peer/src/chain_spec.rs

View workflow job for this annotation

GitHub Actions / Ubuntu 22.04 / build with try-runtime

unused import: `collections::BTreeMap`

use crypto_utils::{authority_keys_from_seed, evm_account_from_seed, get_account_id_from_seed};
use frame_support::BoundedVec;
use hex_literal::hex;
Expand All @@ -15,9 +17,9 @@ use sc_chain_spec_derive::{ChainSpecExtension, ChainSpecGroup};
use sc_service::ChainType;
use serde::{Deserialize, Serialize};
use sp_consensus_babe::AuthorityId as BabeId;
use sp_core::H160;
use sp_finality_grandpa::AuthorityId as GrandpaId;
use sp_runtime::{app_crypto::sr25519, traits::Verify};
use sp_core::{H160, U256};

Check failure on line 22 in crates/humanode-peer/src/chain_spec.rs

View workflow job for this annotation

GitHub Actions / Ubuntu 22.04 / clippy

unused import: `U256`

Check warning on line 22 in crates/humanode-peer/src/chain_spec.rs

View workflow job for this annotation

GitHub Actions / Ubuntu 22.04 / test

unused import: `U256`

Check warning on line 22 in crates/humanode-peer/src/chain_spec.rs

View workflow job for this annotation

GitHub Actions / Ubuntu 22.04 / build

unused import: `U256`

Check warning on line 22 in crates/humanode-peer/src/chain_spec.rs

View workflow job for this annotation

GitHub Actions / Ubuntu 22.04 / test benchmark

unused import: `U256`

Check warning on line 22 in crates/humanode-peer/src/chain_spec.rs

View workflow job for this annotation

GitHub Actions / Ubuntu 22.04 / test-run pallet benchmarks

unused import: `U256`

Check warning on line 22 in crates/humanode-peer/src/chain_spec.rs

View workflow job for this annotation

GitHub Actions / Ubuntu 22.04 / build with try-runtime

unused import: `U256`

/// The concrete chain spec type we're using for the humanode network.
pub type ChainSpec = sc_service::GenericChainSpec<humanode_runtime::GenesisConfig, Extensions>;
Expand Down Expand Up @@ -347,16 +349,34 @@ fn testnet_genesis(
evm_genesis_account(INITIAL_POT_ACCOUNT_BALANCE),
)];

let dev_accounts = vec![
H160::from_str("0xf24FF3a9CF04c71Dbc94D0b566f7A27B94566cac")
.expect("internal H160 is valid; qed"),
H160::from_str("0x3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0")
.expect("internal H160 is valid; qed"),
H160::from_str("0x798d4Ba9baf0064Ec19eB4F0a1a45785ae9D6DFc")
.expect("internal H160 is valid; qed"),
H160::from_str("0x773539d4Ac0e786233D90A233654ccEE26a613D9")
.expect("internal H160 is valid; qed"),
H160::from_str("0xFf64d3F6efE2317EE2807d223a0Bdc4c0c49dfDB")
.expect("internal H160 is valid; qed"),
];

evm_pot_accounts
.into_iter()
.chain(
evm_endowed_accounts
.into_iter()
.map(|k| (k, evm_genesis_account(DEV_ACCOUNT_BALANCE))),
)
.chain(
dev_accounts
.into_iter()
.map(|k| (k, evm_genesis_account(DEV_ACCOUNT_BALANCE))),
)
.collect()
},
},
},
evm_accounts_mapping: Default::default(),
ethereum: EthereumConfig {},
dynamic_fee: Default::default(),
Expand Down
2 changes: 2 additions & 0 deletions crates/humanode-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ pallet-balances = { default-features = false, git = "https://github.com/humanode
pallet-base-fee = { default-features = false, git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.38" }
pallet-dynamic-fee = { default-features = false, git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.38" }
pallet-ethereum = { default-features = false, git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.38" }
fp-evm = { default-features = false, git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.38" }
pallet-evm = { default-features = false, git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.38" }
pallet-evm-balances = { default-features = false, git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.38" }
pallet-evm-precompile-modexp = { default-features = false, git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.38" }
Expand Down Expand Up @@ -146,6 +147,7 @@ std = [
"eip712-account-claim/std",
"eip712-common/std",
"eip712-token-claim/std",
"fp-evm/std",
"fp-rpc/std",
"fp-self-contained/std",
"frame-executive/std",
Expand Down
8 changes: 6 additions & 2 deletions crates/humanode-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -623,10 +623,14 @@ impl pallet_offences::Config for Runtime {
type OnOffenceHandler = OffenceSlasher;
}

const BLOCK_GAS_LIMIT: u64 = 60_000_000;
/// We allow for 2000ms of compute with a 6 second average block time.
pub const WEIGHT_MILLISECS_PER_BLOCK: u64 = 2000;

parameter_types! {
pub BlockGasLimit: U256 = U256::from(u32::max_value());
pub BlockGasLimit: U256 = U256::from(BLOCK_GAS_LIMIT);
pub PrecompilesValue: FrontierPrecompiles<Runtime> = FrontierPrecompiles::<_>::default();
pub WeightPerGas: Weight = Weight::from_ref_time(20_000);
pub WeightPerGas: Weight = Weight::from_parts(fp_evm::weight_per_gas(BLOCK_GAS_LIMIT, NORMAL_DISPATCH_RATIO, WEIGHT_MILLISECS_PER_BLOCK), 0);
}

impl pallet_evm_system::Config for Runtime {
Expand Down

0 comments on commit fa58615

Please sign in to comment.