tendermint / go-amino

Protobuf3 with Interface support - Designed for blockchains (deterministic, upgradeable, fast, and compact)
Other
260 stars 78 forks source link

Wrap basic types in a struct #270

Closed liamsi closed 5 years ago

liamsi commented 5 years ago

ref #204

Note: Instead of switching over all possible cases via reflection (and maybe recursively), this simply adds the bytes. This PR just emulates a wrapping struct.

liamsi commented 5 years ago

I just found another edge-case where this is not complete: when you have an interface and the concrete implementation is a type alias. Will add a test-case and fix shortly.

alexanderbez commented 5 years ago

What's the best way to fully test this for all corner cases @Liamsi ?

liamsi commented 5 years ago

More extensive & more coverage via unit-tests (and maybe extend the fuzzing code too). This would also have been caught, if one for instance ran tendermint / gaia using the modified version in this PR (b/c pub-keys are interfaces and their concrete implementations are type aliases).

I think, we can merge this PR as is. I'll do the change mentioned above in a follow-up PR (issue). Before, we do a release, it would be great if we ran and tested it with tendermint and gaia before (additionally to the fuzzer and more unit tests).

alexanderbez commented 5 years ago

Not a problem, I can easily test that out @Liamsi