tendermint/go-amino

'decoder.go / encoder.go' overflows int issue when cross compile c(for android)

Closed this issue · 5 comments

I've cross-compile cosmos-sdk v0.26.1-rc1 with c(androideabi).
However, an error has occurred.

[Got message]
../../../../vendor/github.com/tendermint/go-amino/decoder.go:246:44: constant -62135596800 overflows int
../../../../vendor/github.com/tendermint/go-amino/decoder.go:246:44: constant 253402300800 overflows int
../../../../vendor/github.com/tendermint/go-amino/encoder.go:147:38: constant -62135596800 overflows int
../../../../vendor/github.com/tendermint/go-amino/encoder.go:147:38: constant 253402300800 overflows int

[Please change both files.]
1. go-amino/decoder.go:246
return 0, n, InvalidTimeErr(fmt.Sprintf("seconds have to be > %d and < %d, got: %d",
minSeconds, maxSeconds, res))

to

return 0, n, InvalidTimeErr(fmt.Sprintf("seconds have to be > %d and < %d, got: %d",
int64(minSeconds), int64(maxSeconds), res))

2. go-amino/encoder.go:147
return InvalidTimeErr(fmt.Sprintf("seconds have to be >= %d and < %d, got: %d",
minSeconds, maxSeconds, s))

to

return InvalidTimeErr(fmt.Sprintf("seconds have to be >= %d and < %d, got: %d",
int64(minSeconds), int64(maxSeconds), s))

Thank you for your hard work.

Thanks for raising this issue! This should have been fixed with #242 though. Did you try to cross-compile amino from the latest master, or the tagged release 0.14.1?
Thanks again!

I'm, sorry. I accidentally made a pull request to the master brench.

No problem. We can change the base branch to develop. Thanks! I'm still sure this problem doesn't exist in the latest release though. Can you try to cross-compile amino 0.14.1? Does the problem still persist?

The issue has been resolved with 0.14.1! Thank you!