diff --git a/scripts/test/get_nft_provider_capability_optional.cdc b/scripts/test/get_nft_provider_capability_optional.cdc index fd175ab..85b8b06 100644 --- a/scripts/test/get_nft_provider_capability_optional.cdc +++ b/scripts/test/get_nft_provider_capability_optional.cdc @@ -7,14 +7,14 @@ import "ExampleNFT" // Verify that a child address borrowed as a child will let the parent borrow an NFT provider capability pub fun main(parent: Address, child: Address, returnsNil: Bool): Bool { let acct = getAuthAccount(parent) - let m = acct.borrow<&HybridCustody.Manager>(from: HybridCustody.ManagerStoragePath) + let manager = acct.borrow<&HybridCustody.Manager>(from: HybridCustody.ManagerStoragePath) ?? panic("manager does not exist") - let childAcct = m.borrowAccount(addr: child) ?? panic("child account not found") + let childAcct = manager.borrowAccount(addr: child) ?? panic("child account not found") - let d = ExampleNFT.resolveView(Type())! as! MetadataViews.NFTCollectionData + let collectionData = ExampleNFT.resolveView(Type())! as! MetadataViews.NFTCollectionData - let nakedCap = childAcct.getCapability(path: d.providerPath, type: Type<&{NonFungibleToken.Provider}>()) + let nakedCap = childAcct.getCapability(path: collectionData.providerPath, type: Type<&{NonFungibleToken.Provider}>()) return returnsNil ? nakedCap == nil : nakedCap?.borrow<&{NonFungibleToken.Provider}>() != nil } \ No newline at end of file