Skip to content

Commit

Permalink
support bytes type
Browse files Browse the repository at this point in the history
  • Loading branch information
ikehara committed Oct 21, 2019
1 parent e2f2d52 commit f069395
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
6 changes: 6 additions & 0 deletions pkg/account/abi/bind/primitives.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ func (s String) Bytes() []byte {
return []byte(s)
}

type Bytes []byte

func (s Bytes) Bytes() []byte {
return s
}

type Address common.Address

func (a Address) Bytes() []byte {
Expand Down
5 changes: 3 additions & 2 deletions pkg/account/abi/bind/template.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pkg/account/abi/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ func (t Type) BoundType() string {
op = "bind.Bool"
case StringTy:
op = "bind.String"
case BytesTy:
op = "bind.Bytes"
case AddressTy:
op = "bind.Address"
case HashTy:
Expand Down
9 changes: 9 additions & 0 deletions pkg/account/cli/bind/template.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f069395

Please sign in to comment.