Merge pull request #179 from ethereum/go-create2

go: Fix support for CREATE2 salt
This commit is contained in:
Paweł Bylica 2019-01-15 20:39:29 +01:00 committed by GitHub
commit 783f5fa8e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -1,5 +1,10 @@
# Changelog # Changelog
## [6.0.2-dev] - unreleased
- Fixed: [[#179](https://github.com/ethereum/evmc/pull/179)]
Add missing salt argument for CREATE2 in Host in Go bindings.
## [6.0.1] - 2018-11-10 ## [6.0.1] - 2018-11-10
- Fixed: [[#169](https://github.com/ethereum/evmc/pull/169)] - Fixed: [[#169](https://github.com/ethereum/evmc/pull/169)]
@ -85,6 +90,7 @@
Constantinople: Storage status is reported back from `evmc_set_storage()`. Constantinople: Storage status is reported back from `evmc_set_storage()`.
[6.0.2-dev]: https://github.com/ethereum/evmc/compare/v6.0.1...release/6.0
[6.0.1]: https://github.com/ethereum/evmc/releases/tag/v6.0.1 [6.0.1]: https://github.com/ethereum/evmc/releases/tag/v6.0.1
[6.0.0]: https://github.com/ethereum/evmc/releases/tag/v6.0.0 [6.0.0]: https://github.com/ethereum/evmc/releases/tag/v6.0.0
[5.2.0]: https://github.com/ethereum/evmc/releases/tag/v5.2.0 [5.2.0]: https://github.com/ethereum/evmc/releases/tag/v5.2.0

View File

@ -84,7 +84,7 @@ type HostContext interface {
EmitLog(addr common.Address, topics []common.Hash, data []byte) EmitLog(addr common.Address, topics []common.Hash, data []byte)
Call(kind CallKind, Call(kind CallKind,
destination common.Address, sender common.Address, value *big.Int, input []byte, gas int64, depth int, destination common.Address, sender common.Address, value *big.Int, input []byte, gas int64, depth int,
static bool) (output []byte, gasLeft int64, createAddr common.Address, err error) static bool, salt *big.Int) (output []byte, gasLeft int64, createAddr common.Address, err error)
} }
//export accountExists //export accountExists
@ -207,7 +207,7 @@ func call(pCtx unsafe.Pointer, msg *C.struct_evmc_message) C.struct_evmc_result
kind := CallKind(msg.kind) kind := CallKind(msg.kind)
output, gasLeft, createAddr, err := ctx.Call(kind, goAddress(msg.destination), goAddress(msg.sender), goHash(msg.value).Big(), output, gasLeft, createAddr, err := ctx.Call(kind, goAddress(msg.destination), goAddress(msg.sender), goHash(msg.value).Big(),
goByteSlice(msg.input_data, msg.input_size), int64(msg.gas), int(msg.depth), msg.flags != 0) goByteSlice(msg.input_data, msg.input_size), int64(msg.gas), int(msg.depth), msg.flags != 0, goHash(msg.create2_salt).Big())
statusCode := C.enum_evmc_status_code(0) statusCode := C.enum_evmc_status_code(0)
if err != nil { if err != nil {