Skip to content

Commit

Permalink
update iterate script and test access(all)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuahannan committed Apr 15, 2024
1 parent 8d4f496 commit 68c66a2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
8 changes: 2 additions & 6 deletions contracts/ExampleNFT.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ access(all) contract ExampleNFT: NonFungibleToken {
access(all) resource Collection: NonFungibleToken.Collection, ExampleNFTCollectionPublic {
/// dictionary of NFT conforming tokens
/// NFT is a resource type with an `UInt64` ID field
access(contract) var ownedNFTs: @{UInt64: {NonFungibleToken.NFT}}
access(all) var ownedNFTs: @{UInt64: {NonFungibleToken.NFT}}

init () {
self.ownedNFTs <- {}
Expand All @@ -150,11 +150,7 @@ access(all) contract ExampleNFT: NonFungibleToken {
/// Returns whether or not the given type is accepted by the collection
/// A collection that can accept any type should just return true by default
access(all) view fun isSupportedNFTType(type: Type): Bool {
if type == Type<@ExampleNFT.NFT>() {
return true
} else {
return false
}
return type == Type<@ExampleNFT.NFT>()
}

/// withdraw removes an NFT from the collection and moves it to the caller
Expand Down
Loading

0 comments on commit 68c66a2

Please sign in to comment.