File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ pub struct Block {
11
11
provider : ProviderArgs ,
12
12
#[ clap( long, help = "Fetch full transactions instead of hashes only" ) ]
13
13
full : bool ,
14
+ #[ clap( long, help = "Fetch receipts alongside transactions" ) ]
15
+ receipts : bool ,
14
16
#[ clap(
15
17
default_value = "latest" ,
16
18
help = "Block number, hash, or tag (latest/pending)"
@@ -28,7 +30,9 @@ impl Block {
28
30
29
31
let block_id = parse_block_id ( & self . block_id ) ?;
30
32
31
- let block_json = if self . full {
33
+ let block_json = if self . receipts {
34
+ serde_json:: to_value ( provider. get_block_with_receipts ( block_id) . await ?) ?
35
+ } else if self . full {
32
36
serde_json:: to_value ( provider. get_block_with_txs ( block_id) . await ?) ?
33
37
} else {
34
38
serde_json:: to_value ( provider. get_block_with_tx_hashes ( block_id) . await ?) ?
You can’t perform that action at this time.
0 commit comments