Commit ac1ad6aee9837a02e6e35adcddd65518522cdbd6
check if to is undefined
wanderer committed on 3/24/2017, 1:11:58 AMParent: e15a0e55ac98a4fccb6cf5af8247ff7d1123d0a7
Files changed
EVMinterface.js | changed |
common.js | changed |
defaultAgent.js | changed |
tests/interfaceRunner.js | changed |
EVMinterface.js | ||
---|---|---|
@@ -464,9 +464,9 @@ | ||
464 | 464 | callCode (gas, addressOffset, valueOffset, dataOffset, dataLength, resultOffset, resultLength, cbIndex) { |
465 | 465 | this.takeGas(40) |
466 | 466 | // Load the params from mem |
467 | 467 | const path = ['accounts', ...this.getMemory(addressOffset, ADDRESS_SIZE_BYTES), 'code'] |
468 | - const value = U256.fromMemory(this.getMemory(valueOffset, U128_SIZE_BYTES)) | |
468 | + const value = U256.fromBuffer(this.getMemory(valueOffset, U128_SIZE_BYTES)) | |
469 | 469 | |
470 | 470 | // Special case for non-zero value; why does this exist? |
471 | 471 | if (!value.isZero()) { |
472 | 472 | this.takeGas(6700) |
common.js | ||
---|---|---|
@@ -1,8 +1,8 @@ | ||
1 | 1 | const Message = require('./message') |
2 | 2 | |
3 | -exports.PARENT = Symbol('parent') | |
4 | -exports.ROOT = Symbol('root') | |
3 | +exports.PARENT = 0 | |
4 | +exports.ROOT = 1 | |
5 | 5 | exports.getterMessage = (name, path) => { |
6 | 6 | const message = new Message({ |
7 | 7 | data: { |
8 | 8 | getValue: name |
defaultAgent.js | ||
---|---|---|
@@ -1,7 +1,7 @@ | ||
1 | 1 | exports.run = async (message, kernel) => { |
2 | 2 | const to = message.to[message.hops] |
3 | - if (to) { | |
3 | + if (to !== undefined) { | |
4 | 4 | return kernel.send(message) |
5 | 5 | } else if (message.data.getValue) { |
6 | 6 | console.log('get value') |
7 | 7 | return (await kernel.state.get(message.data.getValue)).value |
tests/interfaceRunner.js | ||
---|---|---|
@@ -13,9 +13,8 @@ | ||
13 | 13 | |
14 | 14 | const dir = `${__dirname}/interface` |
15 | 15 | // get the test names |
16 | 16 | let tests = fs.readdirSync(dir).filter((file) => file.endsWith('.wast')) |
17 | -// tests = ['callValue'] | |
18 | 17 | runTests(tests) |
19 | 18 | |
20 | 19 | function runTests (tests) { |
21 | 20 | for (let testName of tests) { |
Built with git-ssb-web