When executing a script that returns a reference, the error that the testing framework gives is unclear:
- FAIL: testGetIterator
Execution failed:
error: slab (0x0.1055) not found: slab not found for stored value
--> tests/example_nft_test.cdc:262:12
Expected Behavior
Since scripts are normally allowed to return reference types, it would make sense to allow returning these types in the testing framework, or at least have a more clear error.
Steps To Reproduce
Run a script from the testing framework that returns a reference, like this one:
import "FungibleToken"
access(all) fun main(account: Address): &{FungibleToken.Balance} {
let vaultRef = getAccount(account)
.capabilities.borrow<&{FungibleToken.Balance}>(/public/flowTokenBalance)
?? panic("Could not borrow Balance reference to the Vault")
return vaultRef
Current Behavior
When executing a script that returns a reference, the error that the testing framework gives is unclear:
Expected Behavior
Since scripts are normally allowed to return reference types, it would make sense to allow returning these types in the testing framework, or at least have a more clear error.
Steps To Reproduce
access(all) fun main(account: Address): &{FungibleToken.Balance} {
}