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

Commit

Permalink
fix cli
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptoAtwill committed Nov 21, 2023
1 parent baf4c74 commit 4da4e1a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 1 addition & 2 deletions ipc/cli/src/commands/crossmsg/topdown_cross.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ impl CommandLineHandler for ListTopdownMsgs {
let parent = subnet
.parent()
.ok_or_else(|| anyhow!("subnet has not parent"))?;
let epoch = provider.get_chain_head_height(&parent).await?;
let hash = provider.get_block_hash(&parent, epoch).await?;
let hash = provider.get_block_hash(&parent, arguments.epoch).await?;
hash.block_hash
};
let msgs = provider
Expand Down
6 changes: 5 additions & 1 deletion ipc/provider/src/manager/evm/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,18 @@ impl TopDownFinalityQuery for EthSubnetManager {

let mut messages = vec![];
for (event, meta) in query_with_meta(ev, gateway_contract.client()).await? {
let msg = CrossMsg::try_from(event.message)?;
log::debug!("received message: {:?} and meta: {:?}", msg, meta);

if meta.block_hash.0 != block_hash {
return Err(anyhow!(
"block hash not equal, input: {}, received: {}",
hex::encode(block_hash),
hex::encode(meta.block_hash.0)
));
}
messages.push(CrossMsg::try_from(event.message)?);

messages.push(msg);
}

Ok(messages)
Expand Down

0 comments on commit 4da4e1a

Please sign in to comment.