Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ethclient/ethclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -914,13 +914,15 @@ type SimulateCallResult struct {
ReturnValue []byte `json:"returnData"`
Logs []*types.Log `json:"logs"`
GasUsed uint64 `json:"gasUsed"`
MaxUsedGas uint64 `json:"maxUsedGas"`
Status uint64 `json:"status"`
Error *CallError `json:"error,omitempty"`
}

type simulateCallResultMarshaling struct {
ReturnValue hexutil.Bytes
GasUsed hexutil.Uint64
MaxUsedGas hexutil.Uint64
Status hexutil.Uint64
}

Expand Down
6 changes: 6 additions & 0 deletions ethclient/ethclient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,12 @@ func TestSimulateV1(t *testing.T) {
if results[0].Calls[0].Error != nil {
t.Errorf("expected no error, got %v", results[0].Calls[0].Error)
}
if results[0].Calls[0].MaxUsedGas == 0 {
t.Error("expected maxUsedGas to be set")
}
if results[0].Calls[0].MaxUsedGas < results[0].Calls[0].GasUsed {
t.Errorf("expected maxUsedGas >= gasUsed, got %d < %d", results[0].Calls[0].MaxUsedGas, results[0].Calls[0].GasUsed)
}
}

func TestSimulateV1WithBlockOverrides(t *testing.T) {
Expand Down
6 changes: 6 additions & 0 deletions ethclient/gen_simulate_call_result.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading