@@ -853,13 +853,21 @@ func (s SimulateBlock) MarshalJSON() ([]byte, error) {
853853 })
854854}
855855
856+ //go:generate go run github.com/fjl/gencodec -type SimulateCallResult -field-override simulateCallResultMarshaling -out gen_simulate_call_result.go
857+
856858// SimulateCallResult is the result of a simulated call.
857859type SimulateCallResult struct {
858- ReturnValue hexutil.Bytes `json:"returnData"`
859- Logs []* types.Log `json:"logs"`
860- GasUsed hexutil.Uint64 `json:"gasUsed"`
861- Status hexutil.Uint64 `json:"status"`
862- Error * CallError `json:"error,omitempty"`
860+ ReturnValue []byte `json:"returnData"`
861+ Logs []* types.Log `json:"logs"`
862+ GasUsed uint64 `json:"gasUsed"`
863+ Status uint64 `json:"status"`
864+ Error * CallError `json:"error,omitempty"`
865+ }
866+
867+ type simulateCallResultMarshaling struct {
868+ ReturnValue hexutil.Bytes
869+ GasUsed hexutil.Uint64
870+ Status hexutil.Uint64
863871}
864872
865873// CallError represents an error from a simulated call.
@@ -869,18 +877,28 @@ type CallError struct {
869877 Data string `json:"data,omitempty"`
870878}
871879
880+ //go:generate go run github.com/fjl/gencodec -type SimulateBlockResult -field-override simulateBlockResultMarshaling -out gen_simulate_block_result.go
881+
872882// SimulateBlockResult represents the result of a simulated block.
873883type SimulateBlockResult struct {
874- Number hexutil. Uint64 `json:"number"`
884+ Number uint64 `json:"number"`
875885 Hash common.Hash `json:"hash"`
876- Timestamp hexutil. Uint64 `json:"timestamp"`
877- GasLimit hexutil. Uint64 `json:"gasLimit"`
878- GasUsed hexutil. Uint64 `json:"gasUsed"`
886+ Timestamp uint64 `json:"timestamp"`
887+ GasLimit uint64 `json:"gasLimit"`
888+ GasUsed uint64 `json:"gasUsed"`
879889 FeeRecipient common.Address `json:"miner"`
880- BaseFeePerGas * hexutil. Big `json:"baseFeePerGas,omitempty"`
890+ BaseFeePerGas * big. Int `json:"baseFeePerGas,omitempty"`
881891 Calls []SimulateCallResult `json:"calls"`
882892}
883893
894+ type simulateBlockResultMarshaling struct {
895+ Number hexutil.Uint64
896+ Timestamp hexutil.Uint64
897+ GasLimit hexutil.Uint64
898+ GasUsed hexutil.Uint64
899+ BaseFeePerGas * hexutil.Big
900+ }
901+
884902// SimulateV1 executes transactions on top of a base state.
885903func (ec * Client ) SimulateV1 (ctx context.Context , opts SimulateOptions , blockNrOrHash * rpc.BlockNumberOrHash ) ([]SimulateBlockResult , error ) {
886904 var result []SimulateBlockResult
0 commit comments