near-runtime-ts icon indicating copy to clipboard operation
near-runtime-ts copied to clipboard

Assert fails to run

Open DanielRX opened this issue 5 years ago • 3 comments

Using assert in contracts leads to

Quering call/contractName/tester failed: wasm execution failed with error: WasmerCallError("Smart contract has explicitly invoked `panic`.").

Expected:The Error message is visible in the RPC return

DanielRX avatar Sep 09 '19 16:09 DanielRX

Do you mind adding a code snippet to repro?

janedegtiareva avatar Sep 12 '19 20:09 janedegtiareva

From the chat:

export function tester(): void {
  assert(false, "Error");
}

fails (without returning the "Error" string) when you call it as a view function

DanielRX avatar Sep 13 '19 09:09 DanielRX

It's an issue with nearlib. @vgrichina will look into it.

bowenwang1996 avatar Sep 13 '19 15:09 bowenwang1996