diff --git a/bindings/go/evmc/evmc.go b/bindings/go/evmc/evmc.go index 78aca3578..56cfa4576 100644 --- a/bindings/go/evmc/evmc.go +++ b/bindings/go/evmc/evmc.go @@ -59,10 +59,13 @@ import ( // Static asserts. const ( - _ = uint(hashLength - C.sizeof_evmc_bytes32) // The size of evmc_bytes32 equals the size of Hash. - _ = uint(C.sizeof_evmc_bytes32 - hashLength) - _ = uint(addressLength - C.sizeof_evmc_address) // The size of evmc_address equals the size of Address. - _ = uint(C.sizeof_evmc_address - addressLength) + // The size of evmc_bytes32 equals the size of Hash. + _ = uint(len(Hash{}) - C.sizeof_evmc_bytes32) + _ = uint(C.sizeof_evmc_bytes32 - len(Hash{})) + + // The size of evmc_address equals the size of Address. + _ = uint(len(Address{}) - C.sizeof_evmc_address) + _ = uint(C.sizeof_evmc_address - len(Address{})) ) type Error int32 diff --git a/bindings/go/evmc/types.go b/bindings/go/evmc/types.go index 7cdfb79e8..9f26edb2f 100644 --- a/bindings/go/evmc/types.go +++ b/bindings/go/evmc/types.go @@ -4,16 +4,8 @@ package evmc -// Lengths of hashes and addresses in bytes. -const ( - // hashLength is the expected length of the hash (in bytes) - hashLength = 32 - // addressLength is the expected length of the address (in bytes) - addressLength = 20 -) - // Hash represents the 32 bytes of arbitrary data (e.g. the result of Keccak256 hash). -type Hash [hashLength]byte +type Hash [32]byte // Address represents the 20 byte address of an Ethereum account. -type Address [addressLength]byte +type Address [20]byte