Skip to content
This repository has been archived by the owner on Apr 8, 2020. It is now read-only.

assert compiles with a missing string but throws a runtime error #43

Open
DanielRX opened this issue Aug 18, 2019 · 0 comments
Open

assert compiles with a missing string but throws a runtime error #43

DanielRX opened this issue Aug 18, 2019 · 0 comments

Comments

@DanielRX
Copy link
Contributor

If I have the following code:

import {storage} from 'near-runtime-ts/near';
export function init(): void {
    storage.set<i32>('Hello', 1);
    const x = storage.get<i32>('Hello');
    assert(x > 10);
}

I get the error:
Transaction BXotTB2zsx91KNbGjqPJGnPfKepLfnko7Cw6MMaGq4Mj failed. Runtime error: wasm async call execution failed with error: Runtime(MemoryAccessViolation) however if I add an error string to the assert, I get:
Transaction 994mXTTmvBR7sGA6whY3CW455ZdnbyA3dEwxLbMxRkai failed. ABORT: "ERROR" filename: "../out/main.ts" line: 5 col: 4

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant