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

chore: Add Send to the API #115

Merged
merged 1 commit into from
Feb 12, 2024
Merged

chore: Add Send to the API #115

merged 1 commit into from
Feb 12, 2024

Conversation

jefft0
Copy link
Contributor

@jefft0 jefft0 commented Feb 12, 2024

The gnoclient API was updated to add support for MsgSend, so this PR adds Send to the gRPC API:

  • Update go.mod to get the latest gnolang/gno.
  • In gnonativetypes.go, add MsgSend, SendRequest and SendResponse.
  • In rpc.proto, add Send.
  • Run make regenerate .
  • Copy api/gen/es/gnonativetypes_pb.* and api/gen/es/rpc_connect.* to gnoboard and hello projects.
  • In api.go, add Send.
  • In all the copies of "use-gno", add send .

I tested this in the goclient example. And I tested it in the gnoboard example with the following code:

    const toAddress = await gno.addressFromBech32("g1juz2yxmdsa6audkp6ep9vfv80c8p5u76e03vvh");
    const send = "1000ugnot";
    const gasFee = '1000000ugnot';
    const gasWanted = 2000000;
    try {
      for await (const response of await gno.send(toAddress, send, gasFee, gasWanted)) {
      }
    } catch (error) {
      console.log(error);
      setAppConsole('error' + JSON.stringify(error));
    }

Signed-off-by: Jeff Thompson <jeff@thefirst.org>
@jefft0 jefft0 requested a review from D4ryl00 February 12, 2024 10:36
Copy link
Contributor

Choose a reason for hiding this comment

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

use-gno lost the ability to send multiple messages at once. For now, we don't have the use case for that, but some other projects can have it. Maybe we should provide the feature now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes we can. use-gno is supposed to simplify the interface. Supporting multiple messages needs an extra structure and is a little more complicated. Should it be a separate function like sendMulti ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, we can skip that for now and reconsider the question when needed.

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 ba2a51a into gnolang:main Feb 12, 2024
@jefft0 jefft0 deleted the chore/add-Send branch February 12, 2024 13:18
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

Successfully merging this pull request may close these issues.

None yet

2 participants