From 9490c1a16f793aec866b1d2a1e0936c13f4b75ef Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Tue, 4 Sep 2018 23:47:32 +0100 Subject: [PATCH] Go: support create2_salt --- bindings/go/evmc/evmc.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bindings/go/evmc/evmc.go b/bindings/go/evmc/evmc.go index d5d7a2a..b61cb6c 100644 --- a/bindings/go/evmc/evmc.go +++ b/bindings/go/evmc/evmc.go @@ -36,9 +36,8 @@ static struct evmc_result execute_wrapper(struct evmc_instance* instance, enum evmc_call_kind kind, uint32_t flags, int32_t depth, int64_t gas, const struct evmc_address* destination, const struct evmc_address* sender, const uint8_t* input_data, size_t input_size, const struct evmc_uint256be* value, - const uint8_t* code, size_t code_size) + const uint8_t* code, size_t code_size, const struct evmc_uint256be* create2_salt) { - struct evmc_uint256be create2_salt = {}; struct evmc_message msg = { kind, flags, @@ -49,7 +48,7 @@ static struct evmc_result execute_wrapper(struct evmc_instance* instance, input_data, input_size, *value, - create2_salt, + *create2_salt, }; struct extended_context ctx = {{&evmc_go_host}, context_index}; @@ -198,7 +197,7 @@ func (instance *Instance) SetOption(name string, value string) (err error) { func (instance *Instance) Execute(ctx HostContext, rev Revision, kind CallKind, static bool, depth int, gas int64, destination common.Address, sender common.Address, input []byte, value common.Hash, - code []byte) (output []byte, gasLeft int64, err error) { + code []byte, create2Salt common.Hash) (output []byte, gasLeft int64, err error) { flags := C.uint32_t(0) if static { @@ -210,10 +209,11 @@ func (instance *Instance) Execute(ctx HostContext, rev Revision, evmcDestination := evmcAddress(destination) evmcSender := evmcAddress(sender) evmcValue := evmcUint256be(value) + evmcCreate2Salt := evmcUint256be(create2Salt) result := C.execute_wrapper(instance.handle, C.int64_t(ctxId), uint32(rev), C.enum_evmc_call_kind(kind), flags, C.int32_t(depth), C.int64_t(gas), &evmcDestination, &evmcSender, bytesPtr(input), C.size_t(len(input)), &evmcValue, - bytesPtr(code), C.size_t(len(code))) + bytesPtr(code), C.size_t(len(code)), &evmcCreate2Salt) removeHostContext(ctxId) output = C.GoBytes(unsafe.Pointer(result.output_data), C.int(result.output_size))