hermeznetwork/hermez-go-sdk

Avoid using strings as types

Opened this issue · 0 comments

In many parts of the code strings are used instead of the actual types, this leads to all sorts of errors and users need to have a deeper understanding of everything. For instance should I send "hez:0x347943..." or 0x347943....

We should take advantage of strong types. We love Go and not JS for many reasons, and this is for sure one of them. JSON formatting should be kept at marshaling level when sending to the API or we could use String() when logging stuff, but we should avoid as much as possible this in public methods / structs.

In this drafted PR I encountered some problems precisely because of this #11