Commit 276e1f2ef76f665728f308c95464327233c1ba98
convert to 0x0d
wanderer committed on 12/28/2016, 4:55:46 PMParent: e46c31f9eba336c3c5c1cec482e028a89c0940be
Files changed
package.json | changed |
tests/buildTests.js | changed |
tests/interface/address.wasm | changed |
tests/interface/address.wast | changed |
tests/interface/balance.wasm | changed |
tests/interface/balance.wast | changed |
tests/interface/basic_gas_ops.wasm | changed |
tests/interface/basic_gas_ops.wast | changed |
tests/interface/call.wasm | changed |
tests/interface/call.wast | changed |
tests/interface/callDataCopy.wasm | changed |
tests/interface/callDataCopy.wast | changed |
tests/interface/callDataSize.wasm | changed |
tests/interface/callDataSize.wast | changed |
tests/interface/callValue.wasm | changed |
tests/interface/callValue.wast | changed |
tests/interface/caller.wasm | changed |
tests/interface/caller.wast | changed |
tests/interface/coinbase.wasm | changed |
tests/interface/coinbase.wast | changed |
tests/interface/origin.wasm | changed |
tests/interface/origin.wast | changed |
tests/interface/sstore.wasm | changed |
tests/interface/sstore.wast | changed |
wasm/interface.wasm | changed |
wasm/interface.wast | changed |
package.json | ||
---|---|---|
@@ -4,9 +4,9 @@ | ||
4 | 4 | "description": "This is a JS prototype of the eWASM kernal.", |
5 | 5 | "scripts": { |
6 | 6 | "lint": "standard", |
7 | 7 | "test": "node --harmony --expose-wasm ./tests/interfaceRunner.js", |
8 | - "build": "node ./tests/buildTests.js" | |
8 | + "build": "node ./tests/buildTests.js && ./tools/wabt/out/wast2wasm ./wasm/interface.wast -o ./wasm/interface.wasm" | |
9 | 9 | }, |
10 | 10 | "repository": { |
11 | 11 | "type": "git", |
12 | 12 | "url": "git+https://github.com/ewasm/ewasm-kernel.git" |
tests/buildTests.js | ||
---|---|---|
@@ -9,6 +9,6 @@ | ||
9 | 9 | // run the tests |
10 | 10 | for (let testName of tests) { |
11 | 11 | testName = testName.split('.')[0] |
12 | 12 | // Compile Command |
13 | - cp.execSync(`${__dirname}/../tools/sexpr-wasm-prototype/out/sexpr-wasm ${dir}/${testName}.wast -o ${dir}/${testName}.wasm`) | |
13 | + cp.execSync(`${__dirname}/../tools/wabt/out/wast2wasm ${dir}/${testName}.wast -o ${dir}/${testName}.wasm`) | |
14 | 14 | } |
tests/interface/address.wasm | ||
---|---|---|
@@ -1,3 +1,3 @@ | ||
1 | - asm type@ @ import ethereum | |
2 | -getAddressfunctionmemoryexport maincode + ݐ������� h | |
3 | - | |
1 | + asm ` ` ethereum | |
2 | +getAddress main memory | |
3 | +! @A A ) Bݐ������� Q@ |
tests/interface/address.wast | ||
---|---|---|
@@ -1,15 +1,15 @@ | ||
1 | 1 | ;; starts with an address of 5d48c1018904a172886829bbbd9c6f4a2d06c47b |
2 | 2 | (module |
3 | + (import "ethereum" "getAddress" (func $address (param i32))) | |
4 | + | |
3 | 5 | (memory 1) |
4 | - | |
5 | - (import $address "ethereum" "getAddress" (param i32)) | |
6 | - (export "main" 0) | |
7 | - (export "a" memory) | |
6 | + (export "main" (func 0)) | |
7 | + (export "memory" (memory 0)) | |
8 | 8 | (func |
9 | 9 | (block |
10 | 10 | ;; loads the address into memory |
11 | - (call_import $address (i32.const 0)) | |
11 | + (call $address (i32.const 0)) | |
12 | 12 | (if (i64.eq (i64.load (i32.const 0)) (i64.const 0x72a1048901c1485d)) |
13 | 13 | (return) |
14 | 14 | ) |
15 | 15 | (unreachable) |
tests/interface/balance.wasm | ||
---|---|---|
@@ -1,6 +1,5 @@ | ||
1 | - asm type | |
2 | -@ @ import ethereum | |
3 | -getBalancefunctionmemoryexport | |
4 | - main1code% | |
5 | - + ��������h | |
6 | -data ]H���r�h)���oJ-�{ | |
1 | + asm | |
2 | +` ` ethereum | |
3 | +getBalance memory main 1 | |
4 | +' | |
5 | + A A A @A ) B��������Q@ A ]H���r�h)���oJ-�{ |
tests/interface/balance.wast | ||
---|---|---|
@@ -1,16 +1,18 @@ | ||
1 | 1 | ;; address of 5d48c1018904a172886829bbbd9c6f4a2d06c47b has a balance of 0x056bc75e2d63100000 (100 ETH) |
2 | 2 | (module |
3 | - (memory 1 (segment 0 "\5d\48\c1\01\89\04\a1\72\88\68\29\bb\bd\9c\6f\4a\2d\06\c4\7b")) | |
4 | - (import $balance "ethereum" "getBalance" (param i32 i32 i32)) | |
5 | - (export "a" memory) | |
6 | - (export "main" 0) | |
7 | - (func | |
8 | - (call_import $balance (i32.const 0) (i32.const 0) (i32.const 1)) | |
3 | + (import "ethereum" "getBalance" (func $balance (param i32 i32 i32))) | |
4 | + (memory 1 ) | |
5 | + (data (i32.const 0) "\5d\48\c1\01\89\04\a1\72\88\68\29\bb\bd\9c\6f\4a\2d\06\c4\7b") | |
6 | + (export "memory" (memory 0)) | |
7 | + (export "main" (func $main)) | |
8 | + (export "1" (func $callback)) | |
9 | + | |
10 | + (func $main | |
11 | + (call $balance (i32.const 0) (i32.const 0) (i32.const 1)) | |
9 | 12 | ) |
10 | - | |
11 | - (export "1" 1) | |
12 | - (func | |
13 | + | |
14 | + (func $callback | |
13 | 15 | (block |
14 | 16 | (if (i64.eq (i64.load (i32.const 0)) (i64.const 0x0500000000000000)) |
15 | 17 | (return) |
16 | 18 | ) |