From f8278b3a3090c3008595717e0c8d549217895434 Mon Sep 17 00:00:00 2001 From: Giovanni Sanchez <108043524+sisyphusSmiling@users.noreply.github.com> Date: Fri, 15 Nov 2024 15:00:29 -0700 Subject: [PATCH] fix Request.canFulfill check --- contracts/RandomConsumer.cdc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/contracts/RandomConsumer.cdc b/contracts/RandomConsumer.cdc index 802c081..ec04cb9 100644 --- a/contracts/RandomConsumer.cdc +++ b/contracts/RandomConsumer.cdc @@ -166,8 +166,13 @@ access(all) contract RandomConsumer { self.fulfilled = false } + /// Returns whether the request can be fulfilled as defined by whether it has already been fulfilled and the + /// created block height has been surpassed. + /// + /// @param: True if it can be fulfille, false otherwise + /// access(all) view fun canFullfill(): Bool { - return !self.fulfilled && getCurrentBlock().height >= self.block + return !self.fulfilled && getCurrentBlock().height > self.block } /// Returns the Flow's random source for the requested block height