Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Query event instead of stream #341

Merged
merged 1 commit into from
Oct 18, 2023
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
4 changes: 1 addition & 3 deletions ipc/provider/src/manager/evm/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ use ethers::prelude::{Signer, SignerMiddleware};
use ethers::providers::{Authorization, Http, Middleware, Provider};
use ethers::signers::{LocalWallet, Wallet};
use ethers::types::{BlockId, Eip1559TransactionRequest, I256, U256};
use futures_util::StreamExt;
use fvm_shared::clock::ChainEpoch;
use fvm_shared::{address::Address, econ::TokenAmount};
use ipc_identity::{EthKeyAddress, EvmKeyStore, PersistentKeyStore};
Expand Down Expand Up @@ -175,11 +174,10 @@ impl TopDownCheckpointQuery for EthSubnetManager {
.event::<NewStakingRequest>()
.from_block(epoch as u64)
.to_block(epoch as u64);
let mut event_stream = ev.stream_with_meta().await?;

let mut changes = vec![];
let mut hash = None;
while let Some(Ok((event, meta))) = event_stream.next().await {
for (event, meta) in ev.query_with_meta().await? {
if let Some(h) = hash {
if h != meta.block_hash {
return Err(anyhow!("block hash not equal"));
Expand Down
Loading