Skip to content

Commit

Permalink
update NFTForwarding pre-conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuahannan committed Sep 25, 2024
1 parent cdaf280 commit 59fef87
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions contracts/utility/NFTForwarding.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ access(all) contract NFTForwarding {
///
access(Mutable) fun changeRecipient(_ newRecipient: Capability<&{NonFungibleToken.Collection}>) {
pre {
newRecipient.check(): "NFTForwarding.NFTForwarder.changeRecipient: Could not borrow NFT Collection reference from the given Capability."
newRecipient.check():
"NFTForwarding.NFTForwarder.init: Could not borrow NFT Collection reference from the given Capability."
.concat(" Ensure the Capability is valid before initializing with recipient.check().")
}

self.recipient = newRecipient
Expand All @@ -98,7 +100,9 @@ access(all) contract NFTForwarding {

init(_ recipient: Capability<&{NonFungibleToken.Collection}>) {
pre {
recipient.check(): "NFTForwarding.NFTForwarder.init: Could not borrow NFT Collection reference from the given Capability"
recipient.check():
"NFTForwarding.NFTForwarder.init: Could not borrow NFT Collection reference from the given Capability."
.concat(" Ensure the Capability is valid before initializing with recipient.check().")
}
self.recipient = recipient
let recipientRef = self.recipient.borrow()!
Expand Down

0 comments on commit 59fef87

Please sign in to comment.