-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Change call send amount to be an array of Coin (#193)
The gnoclient API uses `MsgCall` where the send amount is an [array of `Coin`](https://github.com/gnolang/gno/blob/287c22ec830a1408f1d3de6319602640d841c7cc/gno.land/pkg/sdk/vm/msgs.go#L87). A `Coin` is a struct with [separate fields for Denom and Amount.](https://github.com/gnolang/gno/blob/287c22ec830a1408f1d3de6319602640d841c7cc/tm2/pkg/std/coin.go#L19) 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](https://github.com/gnolang/gnonative/blob/c0f18fd181ae3bc2159090c5199f4725216f9800/service/api.go#L591-L594). 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"](https://github.com/gnolang/gnokey-mobile/blob/f1dc64684f110f71c0465c6a815b2f1b745800e9/mobile/redux/features/signupSlice.ts#L218). After we merge this PR, we will update gnokey-mobile. --------- Signed-off-by: Jeff Thompson <[email protected]>
- Loading branch information
Showing
14 changed files
with
200 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.