From 59fef8708a8196d5be560705bc2902355507ba9a Mon Sep 17 00:00:00 2001 From: Josh Hannan Date: Wed, 25 Sep 2024 16:58:19 -0500 Subject: [PATCH] update NFTForwarding pre-conditions --- contracts/utility/NFTForwarding.cdc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/contracts/utility/NFTForwarding.cdc b/contracts/utility/NFTForwarding.cdc index 4e0da9d..affc8ba 100644 --- a/contracts/utility/NFTForwarding.cdc +++ b/contracts/utility/NFTForwarding.cdc @@ -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 @@ -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()!