Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RandomConsumer.Request.canFulfill() returns invalid boolean when getCurrentBlock() == self.block #27

Open
sisyphusSmiling opened this issue Nov 15, 2024 · 0 comments · May be fixed by #28
Assignees
Labels
Bug Something isn't working

Comments

@sisyphusSmiling
Copy link
Contributor

sisyphusSmiling commented Nov 15, 2024

Description

The following method is invalid when the current block equals the block at which Request was created

access(all) view fun canFullfill(): Bool {
  return !self.fulfilled && getCurrentBlock().height >= self.block
}

The above should be

access(all) view fun canFullfill(): Bool {
  return !self.fulfilled && getCurrentBlock().height > self.block
}

A consumer conditioning a call to Request._fulfill() on .canFulfill() == true would revert as ._fulfill() reverts when block < getCurrentBlock().height. This should be corrected and the contract updated on Testnet & Mainnet

@sisyphusSmiling sisyphusSmiling added the Bug Something isn't working label Nov 15, 2024
@sisyphusSmiling sisyphusSmiling self-assigned this Nov 15, 2024
@sisyphusSmiling sisyphusSmiling moved this to 🏗 In Progress in 🌊 Flow 4D Nov 15, 2024
@sisyphusSmiling sisyphusSmiling linked a pull request Nov 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
Status: 🏗 In Progress
Development

Successfully merging a pull request may close this issue.

1 participant