Skip to content

Commit 4b8e707

Browse files
accounts/abi/bind: fixed genIntType for go 1.12
1 parent a95417f commit 4b8e707

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

accounts/abi/bind/topics.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,15 @@ func makeTopics(query ...[]interface{}) ([][]common.Hash, error) {
9999
return topics, nil
100100
}
101101

102-
func genIntType(rule int64, size int) []byte {
102+
func genIntType(rule int64, size uint) []byte {
103103
var topic [common.HashLength]byte
104104
if rule < 0 {
105105
// if a rule is negative, we need to put it into two's complement.
106106
// extended to common.Hashlength bytes.
107107
topic = [common.HashLength]byte{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}
108108
}
109-
for i := 0; i < size; i++ {
109+
var i uint
110+
for i = 0; i < size; i++ {
110111
topic[common.HashLength-i-1] = byte(rule >> (i * 8))
111112
}
112113
return topic[:]

0 commit comments

Comments
 (0)