Skip to content

Commit

Permalink
Rename some missing return to returnValue (#604)
Browse files Browse the repository at this point in the history
  • Loading branch information
alcuadrado authored and s1na committed Sep 23, 2019
1 parent 3456922 commit 00d8fe3
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/run-blockchain/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async function main() {

await vm.runBlockchain(blockchain)

const blockchainHead = await promisify(vm.blockchain.getHead.bind(vm.blockchain))()
const blockchainHead = await promisify<any>(vm.blockchain.getHead.bind(vm.blockchain))()

console.log('--- Finished processing the BlockChain ---')
console.log('New head:', '0x' + blockchainHead.hash().toString('hex'))
Expand Down
4 changes: 2 additions & 2 deletions examples/run-code-browser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const PUSH1 = '60'
// Note that numbers added are hex values, so '20' would be '32' as decimal e.g.
const code = [PUSH1, '03', PUSH1, '05', ADD, STOP]

vm.on('step', function(data) {
vm.on('step', function (data) {
console.log(`Opcode: ${data.opcode.name}\tStack: ${data.stack}`)
})

Expand All @@ -30,7 +30,7 @@ vm.runCode({
gasLimit: new BN(0xffff),
})
.then(results => {
console.log('Returned : ' + results.return.toString('hex'))
console.log('Returned : ' + results.returnValue.toString('hex'))
console.log('gasUsed : ' + results.gasUsed.toString())
})
.catch(console.error)
2 changes: 1 addition & 1 deletion examples/run-solidity-contract/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ async function getGreeting(vm: VM, contractAddress: Buffer, caller: Buffer) {
throw greetResult.execResult.exceptionError
}

const results = abi.rawDecode(['string'], greetResult.execResult.return)
const results = abi.rawDecode(['string'], greetResult.execResult.returnValue)

return results[0]
}
Expand Down
2 changes: 1 addition & 1 deletion examples/run-transactions-complete/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async function runTx(vm: VM, rawTx: any, privateKey: Buffer) {
})

console.log('gas used: ' + results.gasUsed.toString())
console.log('returned: ' + results.execResult.return.toString('hex'))
console.log('returned: ' + results.execResult.returnValue.toString('hex'))

const createdAddress = results.createdAddress

Expand Down
2 changes: 1 addition & 1 deletion tests/VMTestsRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ module.exports = function runVMTest (options, testData, t, cb) {
}

if (testData.out.slice(2)) {
t.equal(results.return.toString('hex'), testData.out.slice(2), 'valid return value')
t.equal(results.returnValue.toString('hex'), testData.out.slice(2), 'valid return value')
}

if (testData.log && testData.logs.length !== 0) {
Expand Down

0 comments on commit 00d8fe3

Please sign in to comment.