Guide: Check For VRFCoordinator's Callback Using Etherscan API (Lesson 7) #535
Replies: 3 comments 2 replies
-
you are amazing for providing this workaround @ZeroEkkusu |
Beta Was this translation helpful? Give feedback.
-
This is pretty cool @ZeroEkkusu , I just integrated your code into my project too! Thanks! |
Beta Was this translation helpful? Give feedback.
-
Coming back to this topic as Chainlink VRF has been updated to V2. I am having trouble getting this to work properly. I can't seem to figure out how to convert the hex into the actual English readable text and vice versa. Any ideas if i'm even using the right values in the code snippet below? "topic0": Web3.keccak(text='ReceiveRandomNumber(uint256[] numReceived)').hex(),
OR
"topic0": "0x2b9b68a0f2880244fa2999d92504cb5dc5933b0ab58e5bede6671e51de8b74f2", TX: https://rinkeby.etherscan.io/address/0xBF176c97CCcdfa7B9D790664083a95A9b71CFFD9#events |
Beta Was this translation helpful? Give feedback.
-
Gm, fellow devs
In Lesson 7, Patrick used
time.sleep(60)
in his tests to wait for the Chainlink Oracle's response with randomness. However, as reported here, the response can often take much longer and cause tests to fail.I've written a simple
helpful_script
to get the job done using the Etherscan APIThe other way is to listen for events on the node, if you've done that, make a PR to my repo!
Here's how to set it up:
Lottery.sol
, defineand emit it at the end of your
fulfillRandomness()
functionbrownie-config.yaml
, addand, under
networks
>rinkeby
That's it!
Now, you can do your integration testing as follows
The
get_account(env="key1")
part is a modification of theget_account()
function that I've made, but you don't have to do it like that. If you're interested, see my repo.Thanks for coming to my ted talk
Beta Was this translation helpful? Give feedback.
All reactions