Replies: 1 comment 4 replies
-
The only causative factor here is |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to cover all of my lines in my smart contract unit tests with hardhat, and I am not sure how to test the Raffle__TransferFailed() error. Is there some way to force this transaction to fail?
Link to question on StackExchangeETH:
https://ethereum.stackexchange.com/questions/133310/how-to-cause-a-call-to-revert-in-hardhat-test
I have tried implementing a solution I saw to a very similar problem from this stack exchange post.
My solidity TestHelper:
My javascript test:
The problem I encounter now is that the "
transactionResponse
" doesn't fail, but it also doesn't send the funds, revert, or emit the WinnerPicked() event.I have used console.logs to see that the Raffle contract balance doesn't change after
fulfillRandomWords()
is called. Also the recentWinenr is the default 0x00000000 address, despite the TestHelper address being entered into the raffle. The address is even returned when I callraffle.getPlayer(0)
.Here is what my terminal returns:

Beta Was this translation helpful? Give feedback.
All reactions