Skip to content

Commit d1ed689

Browse files
committed
ethereum: Config for calls by number
1 parent 8d55778 commit d1ed689

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chain/ethereum/src/ethereum_adapter.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ lazy_static! {
6666

6767
/// Log eth_call data and target address at trace level. Turn on for debugging.
6868
static ref ETH_CALL_FULL_LOG: bool = std::env::var("GRAPH_ETH_CALL_FULL_LOG").is_ok();
69+
70+
/// This is not deterministic and will be removed after the testnet.
71+
static ref ETH_CALL_BY_NUMBER: bool = std::env::var("GRAPH_ETH_CALL_BY_NUMBER").is_ok();
6972
}
7073

7174
impl<T: web3::Transport> CheapClone for EthereumAdapter<T> {
@@ -406,7 +409,7 @@ where
406409

407410
// Ganache does not support calls by block hash.
408411
// See https://github.com/trufflesuite/ganache-cli/issues/745
409-
let block_id = if self.is_ganache {
412+
let block_id = if self.is_ganache || *ETH_CALL_BY_NUMBER {
410413
BlockId::Number(block_ptr.number.into())
411414
} else {
412415
BlockId::Hash(block_ptr.hash)

0 commit comments

Comments
 (0)