-
Notifications
You must be signed in to change notification settings - Fork 202
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(proto): Add a buf.gen.rs.yaml and corresponding script to create Rust types for Wasm Stargate messages #1579
Conversation
…e Rust types for Wasm Stargate messages
@@ -0,0 +1,173 @@ | |||
#!/usr/bin/env bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend reading main()
and working backwards since bash is a bit hard to follow
Codecov Report
@@ Coverage Diff @@
## master #1579 +/- ##
==========================================
- Coverage 70.73% 70.71% -0.02%
==========================================
Files 181 180 -1
Lines 14917 14786 -131
==========================================
- Hits 10551 10456 -95
+ Misses 3677 3651 -26
+ Partials 689 679 -10 |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Context
This implements:
buf.gen.*.yaml
for Rust code generationgo.mod
for versions and performs thecode generation with
buf
. Generated types end up in the git ignoreddist
folder.CosmosMsg::StargateMsg
#1580For Reviewer
Try running
bash proto/buf.gen.rs.sh
from the root of the repo.You should get the following output:
This should put a bunch of Rust code in your
dist
directory (it's gitignored).Purpose
This is useful for implementing raw smart contract execute calls via
CosmosMsg::StargateMsg
(rather thanCosmosMsg::Custom
). This functionality's needed to develop a Rust package thathas functions for calling TxMsgs from custom modules on Nibiru.
↑ For reference: the messages that can be sent from a contract are as follows: