Calling a pure/view function via a Sapphire-wrapped ethers instance throws a CBOR decode error instead of the actual reason when the call reverts
ISSUE TYPE
Bug Report
STEPS TO REPRODUCE
Deploy a contract containing a Solidity pure/view function that reverts when called
In a Node JS/Typescript project, set up ethers with the Sapphire paratime wrapper
Call the function of the contract you deployed earlier
ACTUAL RESULTS
Error: CBOR decode error: too many terminals, data makes no sense
at Module.decode (file:///home/mirayashi/dev/rpc3/node_modules/cborg/esm/lib/decode.js:131:11)
at X25519DeoxysII.<anonymous> (file:///home/mirayashi/dev/rpc3/node_modules/@oasisprotocol/sapphire-paratime/src/cipher.ts:117:41)
at Generator.next (<anonymous>)
at file:///home/mirayashi/dev/rpc3/node_modules/@oasisprotocol/sapphire-paratime/lib/esm/cipher.js:7:71
at new Promise (<anonymous>)
at __awaiter (file:///home/mirayashi/dev/rpc3/node_modules/@oasisprotocol/sapphire-paratime/lib/esm/cipher.js:3:12)
at X25519DeoxysII.decryptEncoded (file:///home/mirayashi/dev/rpc3/node_modules/@oasisprotocol/sapphire-paratime/lib/esm/cipher.js:83:16)
at file:///home/mirayashi/dev/rpc3/node_modules/@oasisprotocol/sapphire-paratime/src/cipher.ts:274:64
at processTicksAndRejections (node:internal/process/task_queues:95:5)
EXPECTED RESULTS
I'm expecting to get a more informative error from ethers like
Error: call revert exception; VM Exception while processing transaction: reverted with reason xxx
SUMMARY
Calling a pure/view function via a Sapphire-wrapped ethers instance throws a CBOR decode error instead of the actual reason when the call reverts
ISSUE TYPE
STEPS TO REPRODUCE
ACTUAL RESULTS
EXPECTED RESULTS
I'm expecting to get a more informative error from ethers like
VERSIONS
@oasisprotocol/sapphire-paratime@1.1.1
ethers@5.7.2