Comments (2)
@r3v4s the way that native imports are implemented are that when you import a package, ie. you write import "std"
, the gnovm loads the package's symbols, and on top of them some extra native bindings.
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 case "std"
to case "std", "internal/stdnative"
; so that after that, calling GetOrigCaller becomes possible from banker.gno, by importing internal/stdnative
.
from gno.
@r3v4s the way that native imports are implemented are that when you import a package, ie. you write
import "std"
, the gnovm loads the package's symbols, and on top of them some extra native bindings.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
case "std"
tocase "std", "internal/stdnative"
; so that after that, calling GetOrigCaller becomes possible from banker.gno, by importinginternal/stdnative
.
thx @thehowl, perhaps I have to stick with internal/stdnative
for now.
I'll keep my eye open for your #814 :D
from gno.
Related Issues (20)
- `[]byte("string")` created in for loops are "persisted" on iteration
- rfc: enforce package name == last element of import path in `maketx addpkg`
- `println` panics on byte pointer types HOT 1
- Making the `std` package API more user-friendly HOT 2
- Replacing `GetOrigCaller()` with `PrevRealm.Addr()` HOT 7
- Realms as EOAs HOT 1
- Split the `docs` website to its own repo
- gnovm(bug): time.Time rendering causes Machine Panic HOT 2
- rfc: move `examples` to `gno.land/genesis` HOT 4
- contribs/gnok: gnokey but with 33% fewer keystrokes HOT 2
- supporting different expressions for `maketx run`
- Improve Gnodev HOT 2
- gno lint should warn when using `std.GetOrigCaller`
- support variadic types as function args in MsgCall
- update gnoweb favicon
- RFC: Coin vs Token HOT 5
- The Address type in crypto.gno and crypto.go have different types HOT 3
- Support slices & structs as arguments to `maketx call` HOT 1
- Make the output of `gno precompile` more parseable
- type assertion on recovered `nil`s panics HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gno.