Skip to content

Commit

Permalink
update test script variable names for specificity
Browse files Browse the repository at this point in the history
  • Loading branch information
sisyphusSmiling committed Oct 5, 2023
1 parent ccb3637 commit 8c1297a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/test/get_nft_provider_capability_optional.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -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<MetadataViews.NFTCollectionData>())! as! MetadataViews.NFTCollectionData
let collectionData = ExampleNFT.resolveView(Type<MetadataViews.NFTCollectionData>())! 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
}

0 comments on commit 8c1297a

Please sign in to comment.