Skip to content

Commit

Permalink
fix test scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
nialexsan committed Sep 30, 2024
1 parent 4aea638 commit bea9daa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
9 changes: 1 addition & 8 deletions cadence/scripts/get_examplenft_type.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,5 @@ import "NonFungibleToken"
import "ExampleNFT"

access(all) fun main(): String {
let x = ReferenceType(entitlements: ["A.f8d6e0586b0a20c7.NonFungibleToken.Withdraw"], type: CompositeType(Type<@ExampleNFT.Collection>().identifier)!)
let y = ReferenceType(entitlements: [], type: CompositeType(Type<@ExampleNFT.Collection>().identifier)!)
//let y = CompositeType("A.f8d6e0586b0a20c7.ExampleNFT.Collection")
//return y!.identifier
//return x!.identifier
return Type<&ExampleNFT.NFT>().identifier


return Type<@ExampleNFT.NFT>().identifier
}
5 changes: 4 additions & 1 deletion cadence/transactions/add_to_nft_catalog.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ transaction(
publicPathIdentifier: String
) {
let adminProxyRef : auth(NFTCatalogAdmin.CatalogActions) &NFTCatalogAdmin.AdminProxy
let nftType: Type

prepare(acct: auth(BorrowValue) &Account) {
self.nftType = CompositeType(nftTypeIdentifer)
?? panic("Could not construct NFT type from identifier ".concat(nftTypeIdentifer))
self.adminProxyRef = acct.storage.borrow<auth(NFTCatalogAdmin.CatalogActions) &NFTCatalogAdmin.AdminProxy>(from: NFTCatalogAdmin.AdminProxyStoragePath)!
}

Expand All @@ -38,7 +41,7 @@ transaction(
let catalogData = NFTCatalog.NFTCatalogMetadata(
contractName: contractName,
contractAddress: contractAddress,
nftType: CompositeType(nftTypeIdentifer)!,
nftType: self.nftType,
collectionData: collectionData,
collectionDisplay : collectionDisplay
)
Expand Down

0 comments on commit bea9daa

Please sign in to comment.