Skip to content

Commit

Permalink
fix: call tracer
Browse files Browse the repository at this point in the history
  • Loading branch information
clostao committed Feb 13, 2024
1 parent abbc11c commit b9cf098
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 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
5 changes: 4 additions & 1 deletion vendor/client/evm-tracing/src/formatters/call_tracer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ impl super::ResponseFormatter for Formatter {
for entry in listener.entries.iter() {
let mut result: Vec<Call> = entry
.into_iter()
.filter(|(_, it)| it.from.ne(&H160::zero()))
.map(|(_, it)| {
let from = it.from;
let trace_address = it.trace_address.clone();
Expand Down Expand Up @@ -208,7 +209,9 @@ impl super::ResponseFormatter for Formatter {
}),
) => {
&b[..]
== &a[..]
== a.get(0..a.len() - 1).expect(
"non-root element while traversing trace result",
)
}
_ => unreachable!(),
}) {
Expand Down

0 comments on commit b9cf098

Please sign in to comment.