F
Flow9mo ago
Giovanni S

Giovanni S | Flow (2023-09-21)

Reposting a question I ended up finding the answer to on my own so others can reference when updating to Cadence 1.0:
In Cadence 1.0, what's the equivalent of getAuthAccount() for use in scripts - is there one? I tried let account: auth(Storage) &Account = getAccount(address), but looks like getAccount(address) returns non-auth &Account
Realized I had to statically type the entitled reference - let account = getAuthAccount<auth(Storage) &Account>(address)
3 Replies
Needle
Needle9mo ago
I've created a thread for your message. Please continue any relevant discussion in this thread. You can rename this thread using /title <new title> If this is a technical question that others may benefit from, considering also asking it on Stackoverflow: https://stackoverflow.com/questions/ask?tags=onflow-cadence
turbolent
turbolent9mo ago
Basically, one has to specifically say what kind of auth reference one wants to have. Before there were only fully authorized account references, now the access is more granular (with entitlements)