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

fix: Change call send amount to be an array of Coin #193

Merged
merged 3 commits into from
Oct 30, 2024

Conversation

jefft0
Copy link
Contributor

@jefft0 jefft0 commented Oct 30, 2024

The gnoclient API uses MsgCall where the send amount is an array of Coin. A Coin is a struct with separate fields for Denom and Amount. However, the Gno Native Kit API uses a string such as "1000ugnot" (from the original version of gnoclient). Similar to PR #191 for MsgSend, we want to track the current gnoclient API. This PR has three commits:

  1. Update go.mod to use the latest gnokey-mobile. This allows gnonative to compile after updating to the latest gnolang/gno.
  2. Change the Protobuf MsgCall to use an array of Coin for the Send amount. (The Protobuf Coin type was already defined.) Run make regenerate to make the native interfaces. Update gnoNativeService.convertCallRequest to use the Coin struct, similar to the previous change to convertSendRequest. Run npm install @gnolang/gnonative to install the new API on buf.build.
  3. In expo, update package.json to use the updated bufbuild_es types. Update call and makeCallTx to take an array of Coin.

BREAKING CHANGE: The only code which currently uses the Send amount in MsgCall is where gnokey-mobile calls "Register". After we merge this PR, we will update gnokey-mobile.

@jefft0 jefft0 requested a review from D4ryl00 October 30, 2024 10:51
Copy link
Contributor

@D4ryl00 D4ryl00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jefft0 jefft0 merged commit e4c8952 into gnolang:main Oct 30, 2024
@jefft0 jefft0 deleted the fix/change-call-send-to-Coin-array branch October 30, 2024 11:03
Copy link

🎉 This PR is included in version 4.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants