Skip to content

Commit f069395

Browse files
committed
support bytes type
1 parent e2f2d52 commit f069395

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

pkg/account/abi/bind/primitives.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ func (s String) Bytes() []byte {
8282
return []byte(s)
8383
}
8484

85+
type Bytes []byte
86+
87+
func (s Bytes) Bytes() []byte {
88+
return s
89+
}
90+
8591
type Address common.Address
8692

8793
func (a Address) Bytes() []byte {

pkg/account/abi/bind/template.go

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/account/abi/type.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ func (t Type) BoundType() string {
125125
op = "bind.Bool"
126126
case StringTy:
127127
op = "bind.String"
128+
case BytesTy:
129+
op = "bind.Bytes"
128130
case AddressTy:
129131
op = "bind.Address"
130132
case HashTy:

pkg/account/cli/bind/template.go

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)