Skip to content

Commit

Permalink
fix: main account nonce
Browse files Browse the repository at this point in the history
  • Loading branch information
clostao committed Feb 13, 2024
1 parent abbc11c commit 12726ff
Showing 1 changed file with 14 additions and 16 deletions.
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

0 comments on commit 12726ff

Please sign in to comment.