Skip to content

Commit

Permalink
make emitNFTUpdated access all
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuahannan committed Apr 2, 2024
1 parent 7cbc99e commit 74687e7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions contracts/ExampleNFT.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ access(all) contract ExampleNFT: NonFungibleToken {
// Do not add to your contract unless you have a specific
// reason to want to emit the NFTUpdated event somewhere
// in your contract
// let authTokenRef = (&self.ownedNFTs[id] as auth(NonFungibleToken.Owner) &{NonFungibleToken.NFT}?)!
// //authTokenRef.updateTransferDate(date: getCurrentBlock().timestamp)
// ExampleNFT.emitNFTUpdated(authTokenRef)
let authTokenRef = (&self.ownedNFTs[id] as auth(NonFungibleToken.Owner) &{NonFungibleToken.NFT}?)!
//authTokenRef.updateTransferDate(date: getCurrentBlock().timestamp)
ExampleNFT.emitNFTUpdated(authTokenRef)
}

/// getIDs returns an array of the IDs that are in the collection
Expand Down
2 changes: 1 addition & 1 deletion contracts/NonFungibleToken.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ access(all) contract interface NonFungibleToken: ViewResolver {
/// and query the updated metadata from the owners' collections.
///
access(all) event Updated(type: String, id: UInt64, uuid: UInt64, owner: Address?)
access(contract) view fun emitNFTUpdated(_ nftRef: auth(Update | Owner) &{NonFungibleToken.NFT})
access(all) view fun emitNFTUpdated(_ nftRef: auth(Update | Owner) &{NonFungibleToken.NFT})
{
emit Updated(type: nftRef.getType().identifier, id: nftRef.id, uuid: nftRef.uuid, owner: nftRef.owner?.address)
}
Expand Down
Loading

0 comments on commit 74687e7

Please sign in to comment.