Skip to content

Commit

Permalink
feat: fetch block receipts
Browse files Browse the repository at this point in the history
  • Loading branch information
xJonathanLEI committed May 20, 2024
1 parent 2c890ae commit 9f6612b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 36 deletions.
35 changes: 0 additions & 35 deletions .github/workflows/udeps.yml

This file was deleted.

6 changes: 5 additions & 1 deletion src/subcommands/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ pub struct Block {
provider: ProviderArgs,
#[clap(long, help = "Fetch full transactions instead of hashes only")]
full: bool,
#[clap(long, help = "Fetch receipts alongside transactions")]
receipts: bool,
#[clap(
default_value = "latest",
help = "Block number, hash, or tag (latest/pending)"
Expand All @@ -28,7 +30,9 @@ impl Block {

let block_id = parse_block_id(&self.block_id)?;

let block_json = if self.full {
let block_json = if self.receipts {
serde_json::to_value(provider.get_block_with_receipts(block_id).await?)?
} else if self.full {
serde_json::to_value(provider.get_block_with_txs(block_id).await?)?
} else {
serde_json::to_value(provider.get_block_with_tx_hashes(block_id).await?)?
Expand Down

0 comments on commit 9f6612b

Please sign in to comment.