Open cybercent opened 1 year ago
Might be solved by rent fixes to storage iteration.
We should probably handle this function just like we do storage iteration, i.e. return an "invalid type", instead of aborting the transaction.
@cybercent Where are you running into this? How important is this to you?
I'm iterating over paths on various accounts, in order for the script not to break I'm forced to manually ignore the paths set by contracts that are outdated.
I get into a similar issue when reading data from contracts that force unwrap optionals when the expected data is not there. Many flow contracts wrongly force-unwrap optionals in their own data structures without first checking the data is there so MetadataViews break. These are "quality" projects like MotoGP, Titles etc, not NFT "test contracts".
So maybe one way to handle this is to add a try/catch
to Cadence that would work on scripts but not work on transactions.
Issue to be solved
Users will interact with different contracts in the lifetime of their account and some of those contacts might lag to update to latest Cadence or are left dead.
Currently, there is a crash when reading the
account.type(at: path)
set by a contract that is out of date.Suggested Solution
Return the type without
loading
the broken contract.