cmd/evm: add gasUsed to t8n result (#23919)

* cmd/evm: add gas used accumulator to t8n result

* cmd/evm: update t8n tests to include gas used field
This commit is contained in:
lightclient
2021-11-16 00:43:58 -07:00
committed by GitHub
parent abc74a5ffe
commit b0b708bf23
10 changed files with 26 additions and 15 deletions

View File

@ -55,6 +55,7 @@ type ExecutionResult struct {
Receipts types.Receipts `json:"receipts"`
Rejected []*rejectedTx `json:"rejected,omitempty"`
Difficulty *math.HexOrDecimal256 `json:"currentDifficulty" gencodec:"required"`
GasUsed math.HexOrDecimal64 `json:"gasUsed"`
}
type ommer struct {
@ -255,6 +256,7 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
Receipts: receipts,
Rejected: rejectedTxs,
Difficulty: (*math.HexOrDecimal256)(vmContext.Difficulty),
GasUsed: (math.HexOrDecimal64)(gasUsed),
}
return statedb, execRs, nil
}