diff --git a/bindings/go/evmc/evmc.go b/bindings/go/evmc/evmc.go index bf6ac8912..c0817e129 100644 --- a/bindings/go/evmc/evmc.go +++ b/bindings/go/evmc/evmc.go @@ -205,7 +205,7 @@ 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) { @@ -213,6 +213,9 @@ func (vm *VM) Execute(ctx HostContext, rev Revision, if static { flags |= C.EVMC_STATIC } + if delegated { + flags |= C.EVMC_DELEGATED + } ctxId := addHostContext(ctx) // FIXME: Clarify passing by pointer vs passing by value. diff --git a/bindings/go/evmc/evmc_test.go b/bindings/go/evmc/evmc_test.go index fd6da980a..0c00772a4 100644 --- a/bindings/go/evmc/evmc_test.go +++ b/bindings/go/evmc/evmc_test.go @@ -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) diff --git a/bindings/go/evmc/host_test.go b/bindings/go/evmc/host_test.go index 11eebf3fe..7c092f854 100644 --- a/bindings/go/evmc/host_test.go +++ b/bindings/go/evmc/host_test.go @@ -90,7 +90,7 @@ func TestGetBlockNumberFromTxContext(t *testing.T) { host := &testHostContext{} addr := Address{} h := Hash{} - result, err := vm.Execute(host, Byzantium, Call, false, 1, 100, addr, addr, nil, h, code) + result, err := vm.Execute(host, Byzantium, Call, false, false, 1, 100, addr, addr, nil, h, code) output := result.Output gasLeft := result.GasLeft @@ -121,7 +121,7 @@ func TestCall(t *testing.T) { host := &testHostContext{} addr := Address{} h := Hash{} - result, err := vm.Execute(host, Byzantium, Call, false, 1, 100, addr, addr, nil, h, code) + result, err := vm.Execute(host, Byzantium, Call, false, false, 1, 100, addr, addr, nil, h, code) output := result.Output gasLeft := result.GasLeft diff --git a/include/evmc/evmc.h b/include/evmc/evmc.h index 35e3c0db5..4fc513f7a 100644 --- a/include/evmc/evmc.h +++ b/include/evmc/evmc.h @@ -86,7 +86,8 @@ enum evmc_call_kind /** The flags for ::evmc_message. */ enum evmc_flags { - EVMC_STATIC = 1 /**< Static call mode. */ + EVMC_STATIC = 1, /**< Static call mode. */ + EVMC_DELEGATED = 2 /**< Delegated call mode (EIP-7702). Valid since Prague. */ }; /** @@ -101,7 +102,7 @@ struct evmc_message /** * Additional flags modifying the call execution behavior. - * In the current version the only valid values are ::EVMC_STATIC or 0. + * */ uint32_t flags;