Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amino transactions failing #641

Open
ranlavanet opened this issue Jul 16, 2024 · 1 comment
Open

Amino transactions failing #641

ranlavanet opened this issue Jul 16, 2024 · 1 comment

Comments

@ranlavanet
Copy link

Hi guys, we are having difficulties signing amino transactions. I did some research and would love some clarification.

I noticed all messages contain the following line in their protobufs e.g:
option (amino.name) = "mint/MsgUpdateParams";

is it mandatory to add the amino name in order to sign amino transactions?
we currently don't have the amino.name assigned to any message.

also are there any changes needed in the code of the modules we added on cosmos or is it just the protobuf changes + recompile?

is there an automated way to create the AMINO_MAP file assuming we want to include all lava network transactions in the lavajs repo?

one last question might be related, I wanted to test around a cosmos native amino tx like /cosmos.bank.v1beta1.MsgSend and got the following error:

Type URL '/cosmos.bank.v1beta1.MsgSend' does not exist in the Amino message type register. If you need support for this message type, you can pass in additional entries to the AminoTypes constructor. If you think this message type should be included by default, please open an issue at https://github.com/cosmos/cosmjs/issues.

but even after adding it

    aminoType: 'cosmos-sdk/MsgSend'
  }```
  
 to the amino map file and retranspiling. it still fails with the same message. wondering what am I doing wrong. 
@pyramation
Copy link
Collaborator

pyramation commented Aug 1, 2024

is it mandatory to add the amino name in order to sign amino transactions?

it's not necessary, but helpful if there is no heuristic to compute the amino name.

is there an automated way to create the AMINO_MAP file assuming we want to include all lava network transactions in the lavajs repo?

You can either manually set the names that are registered in Go for amino in the messages, or in telescope options you can register things like the AMINO_MAP or you can write functions that will convert the proto type name to an amino type with some conversion method. If there is some heuristic or logic you can write, a method is possible to convert any lava protos amino names

also are there any changes needed in the code of the modules we added on cosmos or is it just the protobuf changes + recompile?

Yes if you are updating the protos

As a last resort if for some reason they've incorrectly added a name in the proto or you just want to update the protos, this may be the best option: https://github.com/cosmology-tech/telescope?tab=readme-ov-file#json-patch-protos — you can update the protos before having to upstream any proto file changes to the SDK to test it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants