You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is currently not possible to query account storage of accounts, as scripts do not have access to authorized accounts.
Suggested Solution
Add a global function fun getAuthAccount(_ address: Address): AuthAccount,
which returns an authorized account for a given address,
to scripts, but not transactions!
The text was updated successfully, but these errors were encountered:
We currently handle this by ensuring that data that would otherwise require authorized access can be accessed in a non-privileged way (and without trying to return a resource...). For more complex queries we use a method that copies the needed results into a struct. This has the advantage of working in a transaction as well. It has the disadvantage of being more complex.
What happens when the script calls functions that attempt to update storage? Should this revert, should it be simulated, or should there be a keyword for script-safe functions? I'm trying to avoid accidentally introducing const... :-)
Yeah, this issue originated from the feedback on how complicated (or even impossible) is is to read account storage currently. It really shouldn't be necessary to write boilerplate (e.g. add read capabilities or copy data).
What happens when the script calls functions that attempt to update storage?
No, currently scripts don't revert if they mutate state, as this is way too common. If they do, the state changes are simply ignored at the end of the script, and I think we can keep this behavior.
Issue To Be Solved
It is currently not possible to query account storage of accounts, as scripts do not have access to authorized accounts.
Suggested Solution
fun getAuthAccount(_ address: Address): AuthAccount
,which returns an authorized account for a given address,
to scripts, but not transactions!
The text was updated successfully, but these errors were encountered: