You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
UseCalls not getting hit when mining a new block
Hey, I might be doing something wrong here but wanted to double check. Im using your testing suite to test a couple of hooks we have. Everything works well except its all a bit slow. The tests were timing out a lot and I couldnt figure out what it was so I added a try catch. After 15 seconds useCalls gets hit and it updates itself.
tl;dr
Calling the mockContract directly returns the correct result. useCalls takes +10 seconds to realise the updated mockReturn value. Requires a tryCatch around waitForCurrent since test throws on timeout otherwise.
I tried adding refresh: "everyBlock" but was my understanding this was default anyway. I also tried sending an 'evm_mine' to trigger the refresh but didnt seem to help. I've attached to screenshots of my debugging as well as the test code. Basically just changes the mock return value from 12 -> 0, I'm imagining useDapp should pick this up. Inside the hook, there is the same function call that was passed into useCalls, its just in a useEffect and you can see in the logs the updated mock return value is the expected 0. Eventually useCalls picks it up, the test runs for about 15 seconds each time before passing. Am wondering if you guys have any suspicions on what I could be doing wrong.
Software versions
useDapp version (installed version of @usedapp/core): 1.2.10
Package manager: yarn
Node version: 16.14.0
The text was updated successfully, but these errors were encountered:
UseCalls not getting hit when mining a new block
Hey, I might be doing something wrong here but wanted to double check. Im using your testing suite to test a couple of hooks we have. Everything works well except its all a bit slow. The tests were timing out a lot and I couldnt figure out what it was so I added a try catch. After 15 seconds useCalls gets hit and it updates itself.
tl;dr
Calling the mockContract directly returns the correct result. useCalls takes +10 seconds to realise the updated mockReturn value. Requires a tryCatch around
waitForCurrent
since test throws on timeout otherwise.I tried adding
refresh: "everyBlock"
but was my understanding this was default anyway. I also tried sending an 'evm_mine' to trigger the refresh but didnt seem to help. I've attached to screenshots of my debugging as well as the test code. Basically just changes the mock return value from 12 -> 0, I'm imagining useDapp should pick this up. Inside the hook, there is the same function call that was passed into useCalls, its just in a useEffect and you can see in the logs the updated mock return value is the expected 0. Eventually useCalls picks it up, the test runs for about 15 seconds each time before passing. Am wondering if you guys have any suspicions on what I could be doing wrong.Software versions
useDapp
version (installed version of@usedapp/core
):1.2.10
yarn
16.14.0
The text was updated successfully, but these errors were encountered: