fix(trace): rename BlockTrace.Transaction to BlockTrace.Transactions (#47)

This commit is contained in:
HAOYUatHZ 2022-03-18 11:24:57 +08:00 committed by GitHub
parent 3b4875c0d5
commit 9fb413d702
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,14 +9,14 @@ import (
) )
type BlockTrace struct { type BlockTrace struct {
Number *big.Int `json:"number"` Number *big.Int `json:"number"`
Hash common.Hash `json:"hash"` Hash common.Hash `json:"hash"`
GasLimit uint64 `json:"gasLimit"` GasLimit uint64 `json:"gasLimit"`
Difficulty *big.Int `json:"difficulty"` Difficulty *big.Int `json:"difficulty"`
BaseFee *big.Int `json:"baseFee"` BaseFee *big.Int `json:"baseFee"`
Coinbase common.Address `json:"coinbase"` Coinbase common.Address `json:"coinbase"`
Time uint64 `json:"time"` Time uint64 `json:"time"`
Transaction []*TransactionTrace `json:"transaction"` Transactions []*TransactionTrace `json:"transactions"`
} }
type TransactionTrace struct { type TransactionTrace struct {
@ -42,14 +42,14 @@ func NewTraceBlock(config *params.ChainConfig, block *Block) *BlockTrace {
txs[i] = newTraceTransaction(tx, block.NumberU64(), config) txs[i] = newTraceTransaction(tx, block.NumberU64(), config)
} }
return &BlockTrace{ return &BlockTrace{
Number: block.Number(), Number: block.Number(),
Hash: block.Hash(), Hash: block.Hash(),
GasLimit: block.GasLimit(), GasLimit: block.GasLimit(),
Difficulty: block.Difficulty(), Difficulty: block.Difficulty(),
BaseFee: block.BaseFee(), BaseFee: block.BaseFee(),
Coinbase: block.Coinbase(), Coinbase: block.Coinbase(),
Time: block.Time(), Time: block.Time(),
Transaction: txs, Transactions: txs,
} }
} }