Skip to content

Commit

Permalink
Support EVMC_DELEGATED in go bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
gumb0 committed Sep 19, 2024
1 parent b13e713 commit f36f63b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion bindings/go/evmc/evmc.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,17 @@ type Result struct {
}

func (vm *VM) Execute(ctx HostContext, rev Revision,
kind CallKind, static bool, depth int, gas int64,
kind CallKind, static bool, delegated bool, depth int, gas int64,
recipient Address, sender Address, input []byte, value Hash,
code []byte) (res Result, err error) {

flags := C.uint32_t(0)
if static {
flags |= C.EVMC_STATIC
}
if delegated {
flags |= C.EVMC_DELEGATED
}

ctxId := addHostContext(ctx)
// FIXME: Clarify passing by pointer vs passing by value.
Expand Down
2 changes: 1 addition & 1 deletion bindings/go/evmc/evmc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestExecuteEmptyCode(t *testing.T) {

addr := Address{}
h := Hash{}
result, err := vm.Execute(nil, Byzantium, Call, false, 1, 999, addr, addr, nil, h, nil)
result, err := vm.Execute(nil, Byzantium, Call, false, false, 1, 999, addr, addr, nil, h, nil)

if !bytes.Equal(result.Output, []byte("")) {
t.Errorf("execution unexpected output: %x", result.Output)
Expand Down

0 comments on commit f36f63b

Please sign in to comment.