mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 07:06:42 +00:00
cmd/era: add full-tx flag for transaction detail control
Signed-off-by: kevincatty <zhanshanmao@outlook.com>
This commit is contained in:
parent
eb879a76cf
commit
bbbe72c300
1 changed files with 7 additions and 2 deletions
|
|
@ -57,7 +57,11 @@ var (
|
|||
}
|
||||
txsFlag = &cli.BoolFlag{
|
||||
Name: "txs",
|
||||
Usage: "print full transaction values",
|
||||
Usage: "include transaction data in output",
|
||||
}
|
||||
fullTxFlag = &cli.BoolFlag{
|
||||
Name: "full-tx",
|
||||
Usage: "show full transaction details (requires --txs)",
|
||||
}
|
||||
)
|
||||
|
||||
|
|
@ -69,6 +73,7 @@ var (
|
|||
Action: block,
|
||||
Flags: []cli.Flag{
|
||||
txsFlag,
|
||||
fullTxFlag,
|
||||
},
|
||||
}
|
||||
infoCommand = &cli.Command{
|
||||
|
|
@ -122,7 +127,7 @@ func block(ctx *cli.Context) error {
|
|||
return fmt.Errorf("error reading block %d: %w", num, err)
|
||||
}
|
||||
// Convert block to JSON and print.
|
||||
val := ethapi.RPCMarshalBlock(block, ctx.Bool(txsFlag.Name), ctx.Bool(txsFlag.Name), params.MainnetChainConfig)
|
||||
val := ethapi.RPCMarshalBlock(block, ctx.Bool(txsFlag.Name), ctx.Bool(fullTxFlag.Name), params.MainnetChainConfig)
|
||||
b, err := json.MarshalIndent(val, "", " ")
|
||||
if err != nil {
|
||||
return fmt.Errorf("error marshaling json: %w", err)
|
||||
|
|
|
|||
Loading…
Reference in a new issue