You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! I'm working on a transpiler that can hopefully help us solve amino encoding once and for all. In order to do that, I need to understand a bit better how the proto maps between what the developer writes, and the output options.
It seems that some of the options that get generated here are not always inside of the proto files, but are inside of the generated go files. My thought is, if I can understand what this library is doing to create these options, I'll be able to automate any creation of all amino converters that use this library (likely most cosmos chains)
example
In this case, I've changed start_time to startTime
As you can see, it seems that we could derive now the information for how to do the amino<>proto conversion. It seems that the json property is the amino style, and the yaml is the proto — however, this information is not in the .proto file, but instead only in the .pg.go file.
Can somebody point to the algorithm/calculation in this codebase for where this is done? This information would greatly help the ability to generate amino converters.
The text was updated successfully, but these errors were encountered:
The thing is that using camelCase breaks proto convention for naming field names https://developers.google.com/protocol-buffers/docs/style
Amino JSON encoding would rather be snake case which is already in the json struct tag.
Also you still need to get the amino type name anyway.
thanks @blushi t's amazing that you've organized all these issues. I'll dig more into these!
For camelCase, I agree and we're also moving towards using snake case, however some chains including Osmosis currently use it in their proto definitions and I'm just trying to support existing definitions. I'm curious how/if the new migration would change the amino converters on the JS side of things.
Hello! I'm working on a transpiler that can hopefully help us solve amino encoding once and for all. In order to do that, I need to understand a bit better how the proto maps between what the developer writes, and the output options.
It seems that some of the options that get generated here are not always inside of the proto files, but are inside of the generated go files. My thought is, if I can understand what this library is doing to create these options, I'll be able to automate any creation of all amino converters that use this library (likely most cosmos chains)
example
In this case, I've changed
start_time
tostartTime
original
in osmosis is where I'm testing, and I run
make proto-all
, which results in a change to the filex/epochs/types/genesis.pb.go
As you can see, it seems that we could derive now the information for how to do the amino<>proto conversion. It seems that the
json
property is the amino style, and theyaml
is the proto — however, this information is not in the.proto
file, but instead only in the.pg.go
file.Can somebody point to the algorithm/calculation in this codebase for where this is done? This information would greatly help the ability to generate amino converters.
The text was updated successfully, but these errors were encountered: