Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix main account nonce #170

Merged
merged 2 commits into from
Feb 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 14 additions & 16 deletions node/src/chain_spec/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use serde::{Deserialize, Serialize};
use sp_core::{bytes::from_hex, ecdsa, H160, H256, U256};
use sp_consensus_grandpa::AuthorityId as GrandpaId;
use sp_core::{bytes::from_hex, ecdsa, H160, H256, U256};
use stability_runtime::{AccountId, GenesisConfig, Precompiles, ValidatorFeeSelectorConfig};
use std::{collections::BTreeMap, str::FromStr, vec};
// Substrate
Expand All @@ -13,8 +13,8 @@ use stability_runtime::{opaque::SessionKeys, EnableManualSeal, Signature};
pub mod alphanet;
pub mod betanet;
pub mod dev;
pub mod testnet;
pub mod mainnet;
pub mod testnet;

// The URL for the telemetry server.
// const STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/";
Expand Down Expand Up @@ -147,19 +147,17 @@ pub fn base_genesis(
accounts: {
let mut map = BTreeMap::new();
let revert_bytecode = vec![0x60, 0x00, 0x60, 0x00, 0xFD];
Precompiles::used_addresses()
.into_iter()
.for_each(|addr| {
map.insert(
H160(addr.0),
fp_evm::GenesisAccount {
nonce: Default::default(),
balance: Default::default(),
storage: Default::default(),
code: revert_bytecode.clone(),
},
);
});
Precompiles::used_addresses().into_iter().for_each(|addr| {
map.insert(
H160(addr.0),
fp_evm::GenesisAccount {
nonce: Default::default(),
balance: Default::default(),
storage: Default::default(),
code: revert_bytecode.clone(),
},
);
});
map.insert(initial_default_token, fp_evm::GenesisAccount {
nonce: Default::default(),
balance: Default::default(),
Expand All @@ -179,7 +177,7 @@ pub fn base_genesis(
map.insert(
main_account,
fp_evm::GenesisAccount {
nonce: U256::from(1),
nonce: U256::from(2),
balance: Default::default(),
storage: Default::default(),
code: Default::default(),
Expand Down
Loading