Skip to content

Commit

Permalink
go: Fixes and CREATE2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Jul 26, 2018
1 parent f7f6437 commit 53a2613
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bindings/go/evmc/evmc.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ static struct evmc_result execute_wrapper(struct evmc_instance* instance, int64_
_GoBytes_ destination, _GoBytes_ sender, _GoBytes_ value, _GoBytes_ input, _GoBytes_ code_hash, int64_t gas,
int32_t depth, uint32_t flags, _GoBytes_ code)
{
struct evmc_message msg;
struct evmc_message msg = {};
msg.input_data = input.p;
msg.input_size = input.n;
msg.gas = gas;
Expand Down Expand Up @@ -152,13 +152,13 @@ func Load(filename string) (instance *Instance, err error) {
case C.EVMC_LOADER_SYMBOL_NOT_FOUND:
err = fmt.Errorf("evmc loader: the EVMC create function not found in %s", filename)
case C.EVMC_LOADER_INVALID_ARGUMENT:
panic("evmc loader: filename argument is empty")
panic("evmc loader: filename argument is invalid")
case C.EVMC_LOADER_INSTANCE_CREATION_FAILURE:
err = errors.New("evmc loader: VM instance creation failure")
case C.EVMC_LOADER_ABI_VERSION_MISMATCH:
err = errors.New("evmc loader: ABI version mismatch")
default:
panic(fmt.Sprintf("evmc loader: unexpected error (%d)", loaderErr))
panic(fmt.Sprintf("evmc loader: unexpected error (%d)", int(loaderErr)))
}
return instance, err
}
Expand Down
1 change: 1 addition & 0 deletions bindings/go/evmc/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const (
DelegateCall = C.EVMC_DELEGATECALL
CallCode = C.EVMC_CALLCODE
Create = C.EVMC_CREATE
Create2 = C.EVMC_CREATE2
)

func goAddress(in C.struct_evmc_address) common.Address {
Expand Down

0 comments on commit 53a2613

Please sign in to comment.