-
Notifications
You must be signed in to change notification settings - Fork 373
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: gnoclient: Require Caller in Msg. Remove syntax sugar Msgs #2715
chore: gnoclient: Require Caller in Msg. Remove syntax sugar Msgs #2715
Conversation
Signed-off-by: Jeff Thompson <[email protected]>
61e0d49
to
453aba8
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2715 +/- ##
==========================================
- Coverage 60.23% 60.21% -0.02%
==========================================
Files 562 562
Lines 75091 75026 -65
==========================================
- Hits 45228 45179 -49
+ Misses 26482 26474 -8
+ Partials 3381 3373 -8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
…use ErrorContains Signed-off-by: Jeff Thompson <[email protected]>
Signed-off-by: Jeff Thompson <[email protected]>
Hey @jefft0, please make sure to update the official documentation if needed as well, for example the how-to guide. 🙏 https://github.com/gnolang/gno/blob/master/docs/how-to-guides/connecting-from-go.md |
Signed-off-by: Jeff Thompson <[email protected]>
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.
Now it's super simple 💅
Looks good 💯
Signed-off-by: Jeff Thompson <[email protected]>
BREAKING CHANGE: The gnoclient API provides "syntax sugar" slices of messages like MsgCall. This PR removes them and instead uses the vm message definitions directly (without modification). This requires users of the gnoclient API to specify all needed fields, including
Caller
but it also simplifies the Sign logic. The concerns of message creation and message handling are now separated.MsgCall
,MsgSend
,MsgRun
andMsgAddPackage
.validateMsgCall
,validateMsgSend
,validateMsgRun
andvalidateMsgAddPackage
.Call
, etc. change themsgs
param to usevm.MsgCall
, etc. Use theValidateBasic
method of these types.Caller
from theSigner
. Expect theCaller
field to already be filled in.Caller
where needed.expectedError
to a string and useassert.ErrorContains
. (This allows mixing errors that are defined by a type with errors defined as singleton objects.)vm.MsgCall
.Contributors' checklist...
BREAKING CHANGE: xxx
message was included in the description