Skip to content

Commit

Permalink
FIX: filter event by contract (#798)
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptoAtwill authored Mar 15, 2024
1 parent 0babe1b commit 3b2e156
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ipc/provider/src/manager/evm/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use ethers::prelude::k256::ecdsa::SigningKey;
use ethers::prelude::{Signer, SignerMiddleware};
use ethers::providers::{Authorization, Http, Middleware, Provider};
use ethers::signers::{LocalWallet, Wallet};
use ethers::types::{Eip1559TransactionRequest, I256, U256};
use ethers::types::{Eip1559TransactionRequest, ValueOrArray, I256, U256};
use fvm_shared::clock::ChainEpoch;
use fvm_shared::{address::Address, econ::TokenAmount};
use ipc_api::checkpoint::{
Expand Down Expand Up @@ -132,7 +132,8 @@ impl TopDownFinalityQuery for EthSubnetManager {
.event::<lib_gateway::NewTopDownMessageFilter>()
.from_block(epoch as u64)
.to_block(epoch as u64)
.topic1(topic1);
.topic1(topic1)
.address(ValueOrArray::Value(gateway_contract.address()));

let mut messages = vec![];
let mut hash = None;
Expand Down Expand Up @@ -193,7 +194,8 @@ impl TopDownFinalityQuery for EthSubnetManager {
let ev = contract
.event::<lib_staking_change_log::NewStakingChangeRequestFilter>()
.from_block(epoch as u64)
.to_block(epoch as u64);
.to_block(epoch as u64)
.address(ValueOrArray::Value(contract.address()));

let mut changes = vec![];
let mut hash = None;
Expand Down Expand Up @@ -1102,7 +1104,8 @@ impl BottomUpCheckpointRelayer for EthSubnetManager {
let ev = contract
.event::<lib_quorum::QuorumReachedFilter>()
.from_block(height as u64)
.to_block(height as u64);
.to_block(height as u64)
.address(ValueOrArray::Value(contract.address()));

let mut events = vec![];
for (event, _meta) in query_with_meta(ev, contract.client()).await? {
Expand Down

0 comments on commit 3b2e156

Please sign in to comment.