Skip to content

Commit

Permalink
go: Add static asserts to check sizes of Hash and Address
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Jul 26, 2018
1 parent 0b5d0e4 commit c4be8db
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bindings/go/evmc/evmc.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ import (
"github.com/ethereum/go-ethereum/common"
)

// Static asserts.
const (
_ = uint(common.HashLength - C.sizeof_struct_evmc_uint256be) // The size of evmc_uint256be equals the size of Hash.
_ = uint(C.sizeof_struct_evmc_uint256be - common.HashLength)
_ = uint(common.AddressLength - C.sizeof_struct_evmc_address) // The size of evmc_address equals the size of Address.
_ = uint(C.sizeof_struct_evmc_address - common.AddressLength)
)

type Error int32

func (err Error) IsInternalError() bool {
Expand Down

0 comments on commit c4be8db

Please sign in to comment.