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

Commit

Permalink
list in range
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptoAtwill committed Nov 30, 2023
1 parent 28840fb commit 5d6009c
Showing 1 changed file with 24 additions and 11 deletions.
35 changes: 24 additions & 11 deletions ipc/cli/src/commands/crossmsg/topdown_cross.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,24 @@ impl CommandLineHandler for ListTopdownMsgs {
let provider = get_ipc_provider(global)?;
let subnet = SubnetID::from_str(&arguments.subnet)?;

let result = provider.get_top_down_msgs(&subnet, arguments.epoch).await?;
println!("block hash: {}", hex::encode(result.block_hash));
for msg in result.value {
for h in arguments.from..=arguments.to {
let result = provider.get_top_down_msgs(&subnet, h).await?;
println!(
"from: {}, to: {}, value: {}, nonce: {}, fee: {} ",
msg.msg.from.to_string()?,
msg.msg.to.to_string()?,
msg.msg.value,
msg.msg.nonce,
msg.msg.fee
"block height: {}, block hash: {}, number of messages: {}",
h,
hex::encode(result.block_hash),
result.value.len()
);
for msg in result.value {
println!(
"from: {}, to: {}, value: {}, nonce: {}, fee: {} ",
msg.msg.from.to_string()?,
msg.msg.to.to_string()?,
msg.msg.value,
msg.msg.nonce,
msg.msg.fee
);
}
}

Ok(())
Expand All @@ -48,8 +55,14 @@ impl CommandLineHandler for ListTopdownMsgs {
pub(crate) struct ListTopdownMsgsArgs {
#[arg(long, short, help = "The subnet id of the topdown subnet")]
pub subnet: String,
#[arg(long, short, help = "Include topdown messages of this epoch")]
pub epoch: ChainEpoch,
#[arg(
long,
short,
help = "Include topdown messages starting from this epoch"
)]
pub from: ChainEpoch,
#[arg(long, short, help = "Include topdown messages to this epoch")]
pub to: ChainEpoch,
}

pub(crate) struct LatestParentFinality;
Expand Down

0 comments on commit 5d6009c

Please sign in to comment.