From c6ad91173fee4a9fe7759c1367554816b4b0e9ed Mon Sep 17 00:00:00 2001 From: wanderer Date: Mon, 12 Sep 2016 16:04:21 -0400 Subject: [PATCH] EEI: include async interface --- eth_interface.md | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/eth_interface.md b/eth_interface.md index ceeee749..feb50255 100644 --- a/eth_interface.md +++ b/eth_interface.md @@ -15,6 +15,9 @@ We also define the following WebAssembly data types: - `i32ptr`: same as `i32` in WebAssembly, but treated as a pointer to a WebAssembly memory offset - `i64`: same as `i64` in WebAssembly +# Tables +A table named 'callbacks' must be exported if any callbacks are used + # API ## useGas @@ -82,10 +85,11 @@ Sends a message with arbitrary date to a given address path - `dataLength` **i32** the length of data - `resultOffset` **i32ptr** the memory offset to store the result data at (`bytes`) - `resultLength` **i32** the maximal length of result data +- `callBackIndex` **i32** an index of the callback function -**Returns** +**Callback Index** -`result` **i32** Returns 1 or 0 depending on if the VM trapped on the message or not +- `result` **i32** 1 or 0 depending on if the VM trapped on the message or not ## callDataCopy @@ -128,10 +132,11 @@ data passed with the message call instruction or transaction. - `dataLength` **i32** the length of data - `resultOffset` **i32ptr** the memory offset to store the result data at (`bytes`) - `resultLength` **i32** the maximal length of result data +- `callBackIndex` **i32** an index of the callback function -**Returns** +**Callback Index** -`result` **i32** Returns 1 or 0 depending on if the VM trapped on the message or not +- `result` **i32** 1 or 0 depending on if the VM trapped on the message or not ## callDelegate @@ -146,10 +151,10 @@ persisting the current values for sender and value. - `dataLength` **i32** the length of data - `resultOffset` **i32ptr** the memory offset to store the result data at (`bytes`) - `resultLength` **i32** the maximal length of result data +- `callBackIndex` **i32** an index of the callback function -**Returns** - -`result` **i32** Returns 1 or 0 depending on if the VM trapped on the message or not +**Callback Index** +- `result` **i32** Returns 1 or 0 depending on if the VM trapped on the message or not ## storageStore @@ -159,8 +164,9 @@ Store 256-bit a value in memory to persistent storage - `pathOffest` **i32ptr** the memory offset to load the path from (`u256`) - `valueOffset` **i32ptr** the memory offset to load the value from (`u256`) +- `callBackIndex` **i32** an index of the callback function -**Returns** +**Callback Signature** *nothing* @@ -172,8 +178,9 @@ Loads a 256-bit a value to memory from persistent storage - `pathOffest` **i32ptr** the memory offset to load the path from (`u256`) - `resultOffset` **i32ptr** the memory offset to store the result at (`u256`) +- `callBackIndex` **i32** an index of the callback function -**Returns** +**Callback Index** *nothing* @@ -251,10 +258,11 @@ Creates a new contract with a given value. - `dataOffset` **i32ptr** the memory offset to load the code for the new contract from (`bytes`) - `length` **i32** the data length - `resultOffset` **i32ptr** the memory offset to write the new contract address to (`address`) +- `callBackIndex` **i32** an index of the callback function -**Returns** +**Callback Index** +- `result` **i32** 1 or 0 depending on if the VM trapped on the message or not -`result` **i32** Returns 1 or 0 depending on if the VM trapped on the message or not ## getBlockDifficulty @@ -278,8 +286,9 @@ Copies the code of an account to memory. - `resultOffset` **i32ptr** the memory offset to load the result into (`bytes`) - `codeOffset` **i32** the offset within the code - `length` **i32** the length of code to copy +- `callBackIndex` **i32** an index of the callback function -**Returns** +**Callback Signature** *nothing* @@ -290,10 +299,11 @@ Get size of an account’s code. **Parameters** - `addressOffset` **i32ptr** the memory offset to load the address from (`address`) +- `callBackIndex` **i32** an index of the callback function -**Returns** +**Callback Index** -`extCodeSize` **i32** +- `extCodeSize` **i32** ## getGasLeft