-
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
feat(gnokey): add querying realm balances #2470
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2470 +/- ##
==========================================
- Coverage 55.02% 55.01% -0.01%
==========================================
Files 595 595
Lines 79662 79661 -1
==========================================
- Hits 43832 43826 -6
- Misses 32514 32517 +3
- Partials 3316 3318 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
good idea, but it should be implemented from sdk/vm.Handlers, not from keys/client.
The issue is the following; you can find only the VM queries in
On the other hand, I did this change in With my implementation, |
Yes, that's exactly where I recommend implementing it: directly from this package, instead of from |
i := strings.Index(path, balancesQuery) | ||
pkgPath := path[i+len(balancesQuery):] | ||
|
||
pkgAddr := gnolang.DerivePkgAddr(pkgPath) |
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.
tm2
should not import gnovm/
or gno.land/
.
Description
Closes: #2469
This PR adds code to the handler in
gnokey
that extends thebank/balances
functionality to allow users to fetch the balance of a realm given its pkgpath, iebank/balances/gno.land/r/demo/wugnot
.Initially I wanted to implement this functionality in the handler for
tm2/sdk/bank
, but in order to not introduce more tm2<>gno dependencies, I did it in thegnokey
query handler. Then, I realized that that handler is also under tm2, intm2/pkg/crypto/keys/client/query.go
:/Contributors' checklist...
BREAKING CHANGE: xxx
message was included in the description