In case WASM will not support asynchronous methods we might need to take an alternative approach. A simple way is to have each operation work with polling, `storageLoad` would become: - `ethereum.storageLoad(args)` - `ethereum.storageLoadResult() -> i32` (where 1 means result is written to the specified memory location) And the following pseudocode in WASM: ``` ethereum.storageLoad() do { result = ethereum.storageLoadResult() } while(!result) ``` The JS interface would need to do the `sleep` then. It's not efficient at all, but there's no way to sleep in WASM.
In case WASM will not support asynchronous methods we might need to take an alternative approach.
A simple way is to have each operation work with polling,
storageLoadwould become:ethereum.storageLoad(args)ethereum.storageLoadResult() -> i32(where 1 means result is written to the specified memory location)And the following pseudocode in WASM:
The JS interface would need to do the
sleepthen. It's not efficient at all, but there's no way to sleep in WASM.