Closed dvec closed 3 years ago
We can't run tests directly in browser, so I think the only solution is to mock window.ethereum
, which may be a tricky task
Sounds like a solution, I'll try to commit it today
I'm wondering why there is a panic at all in case of invalid response while we have web3::error::Error::InvalidResponse
. Especially considering that std::panic::catch_unwind
is not available on wasm
target (what also means that it's impossible to use #[should_panic]
in tests). Can we refuse this behavior and return Err(web3::error::Error::InvalidResponse(...))
instead of panic?
Can we refuse this behavior and return Err(web3::error::Error::InvalidResponse(...)) instead of panic?
Yeah, I just looked at the code and indeed we shouldn't be panicking and definitely the code is not unreachable
as we can tell. If you want to bundle the fix in the same PR I'm fine with that.
Fix #544