FuelLabs/sway
Auf GitHub ansehenAdd a section which documents storage interaction in libraries
Open
#2.872 geöffnet am 27. Sept. 2022
The Sway Bookgood first issue
Repository-Metriken
- Stars
- (61.702 Stars)
- PR-Merge-Metriken
- (Durchschn. Merge 22h 6m) (16 gemergte PRs in 30 T)
Beschreibung
The current documentation does not state whether storage can be "used" inside a library. The cause for concern is that there are cases that work and some that do not therefore it's unclear how to proceed.
The book should have content detailing how a library may or may not interact with storage. This could be added to the "workarounds" section.
For example:
- Can a library have a
storage {}block? - Can a function inside of a library take an argument directly from storage e.g.
fn name(var: storage)wherevarmight be aStorageMapetc. - Can a library simply refer to
storagewithout it being declared anywhere e.g.fn() { storage.thing = 1; }? - Can a library use storage manually via the
getandstorefunctions?