-
Notifications
You must be signed in to change notification settings - Fork 382
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
Calling injected function in same package files (returns undefined error) #876
Comments
@r3v4s the way that native imports are implemented are that when you import a package, ie. you write Notice that this means that native functions are only available to external users of the package; not from the package itself. This is one of the things I aim to improve/fix with #814. For now, if you need to fix the bug, a good idea might be to extend stdlibs.go to go from |
thx @thehowl, perhaps I have to stick with |
<!-- Please provide a brief summary of your changes in the Title above --> # Previous & Related PR #393 # Description ## BREAKING CHANGE: banker will not use raw(input) denom for minting Currently, there is a bug that additional coins are mintable using banker. Lots of discussing were made in #393, this PR include following. 1. It aims to use `pkg_path` that called (banker or Mint) as prefix for denom(Similar to IBC Spec) ``` ibc_denom := 'ibc/' + hash('path' + 'base_denom') denom_in_this_pr := '{pkg_path}:denom' ``` ~2. As @piux2 mentioned [here](#393 (comment)) currently gno has very inflexible format regexp for denom -- Changed to same as Cosmos's regex, but without capitals~ ~### is some issue about using `std.GetOrigCaller` or `std.PrevRealm` Some of you might be wonder why I made some packaged called `istd`, I made a issue: #876~ Update: After @thehowl's native binding PR, doesn't need this kind of work around ## Contributors Checklist - [x] Added new tests, or not needed, or not feasible - [x] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [ ] Updated the official documentation or not needed - [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [x] Added references to related issues and PRs - [ ] Provided any useful hints for running manual tests ## Maintainers Checklist - [ ] Checked that the author followed the guidelines in `CONTRIBUTING.md` - [ ] Checked the conventional-commit (especially PR title and verb, presence of `BREAKING CHANGE:` in the body) - [ ] Ensured that this PR is not a significant change or confirmed that the review/consideration process was appropriate for the change --------- Co-authored-by: Morgan <[email protected]>
<!-- Please provide a brief summary of your changes in the Title above --> # Previous & Related PR gnolang#393 # Description ## BREAKING CHANGE: banker will not use raw(input) denom for minting Currently, there is a bug that additional coins are mintable using banker. Lots of discussing were made in gnolang#393, this PR include following. 1. It aims to use `pkg_path` that called (banker or Mint) as prefix for denom(Similar to IBC Spec) ``` ibc_denom := 'ibc/' + hash('path' + 'base_denom') denom_in_this_pr := '{pkg_path}:denom' ``` ~2. As @piux2 mentioned [here](gnolang#393 (comment)) currently gno has very inflexible format regexp for denom -- Changed to same as Cosmos's regex, but without capitals~ ~### is some issue about using `std.GetOrigCaller` or `std.PrevRealm` Some of you might be wonder why I made some packaged called `istd`, I made a issue: gnolang#876~ Update: After @thehowl's native binding PR, doesn't need this kind of work around ## Contributors Checklist - [x] Added new tests, or not needed, or not feasible - [x] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [ ] Updated the official documentation or not needed - [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [x] Added references to related issues and PRs - [ ] Provided any useful hints for running manual tests ## Maintainers Checklist - [ ] Checked that the author followed the guidelines in `CONTRIBUTING.md` - [ ] Checked the conventional-commit (especially PR title and verb, presence of `BREAKING CHANGE:` in the body) - [ ] Ensured that this PR is not a significant change or confirmed that the review/consideration process was appropriate for the change --------- Co-authored-by: Morgan <[email protected]>
Description
To fix bug #875, I had to use injected function
std.GetOrigCaller
in banker.gno which located in stdGetOrigCaller()
is being injected from here intostd
packagegno/gnovm/stdlibs/stdlibs.go
Lines 247 to 264 in e392ab5
So I thought the package
std
declared by banker.gnogno/gnovm/stdlibs/std/banker.gno
Line 1 in e392ab5
is the same package with
std
inject by stdlibs.gogno/gnovm/stdlibs/stdlibs.go
Line 144 in e392ab5
But calling
GetOrigCaller
in banker.gno returned undefined errorIs is intended structure??
The text was updated successfully, but these errors were encountered: