|
|
@ -148,48 +148,50 @@ contract Ballot { |
|
|
|
winnerName_ = proposals[winningProposal()].name; |
|
|
|
winnerName_ = proposals[winningProposal()].name; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
` |
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
|
|
var privateKey = Buffer.from('dae9801649ba2d95a21e688b56f77905e5667c44ce868ec83f82e838712a2c7a', 'hex') |
|
|
|
(async () => { |
|
|
|
var vm = vmCall.initVM(privateKey) |
|
|
|
var privateKey = Buffer.from('dae9801649ba2d95a21e688b56f77905e5667c44ce868ec83f82e838712a2c7a', 'hex') |
|
|
|
var output = compiler.compile(compilerInput(ballot)) |
|
|
|
var vm = await vmCall.initVM(privateKey) |
|
|
|
output = JSON.parse(output) |
|
|
|
var output = compiler.compile(compilerInput(ballot)) |
|
|
|
var web3VM = new remixLib.vm.Web3VMProvider() |
|
|
|
output = JSON.parse(output) |
|
|
|
web3VM.setVM(vm) |
|
|
|
var web3VM = new remixLib.vm.Web3VMProvider() |
|
|
|
const param = '0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000148656c6c6f20576f726c64210000000000000000000000000000000000000000' |
|
|
|
web3VM.setVM(vm) |
|
|
|
vmCall.sendTx(vm, {nonce: 0, privateKey: privateKey}, null, 0, output.contracts['test.sol']['Ballot'].evm.bytecode.object + param, (error, txHash) => { |
|
|
|
const param = '0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000148656c6c6f20576f726c64210000000000000000000000000000000000000000' |
|
|
|
console.log(error, txHash) |
|
|
|
vmCall.sendTx(vm, {nonce: 0, privateKey: privateKey}, null, 0, output.contracts['test.sol']['Ballot'].evm.bytecode.object + param, (error, txHash) => { |
|
|
|
if (error) { |
|
|
|
console.log(error, txHash) |
|
|
|
throw error |
|
|
|
if (error) { |
|
|
|
} else { |
|
|
|
throw error |
|
|
|
web3VM.eth.getTransaction(txHash, (error, tx) => { |
|
|
|
} else { |
|
|
|
if (error) { |
|
|
|
web3VM.eth.getTransaction(txHash, (error, tx) => { |
|
|
|
throw error |
|
|
|
if (error) { |
|
|
|
} else { |
|
|
|
|
|
|
|
var debugManager = new Debugger({ |
|
|
|
|
|
|
|
compilationResult: function () { |
|
|
|
|
|
|
|
return { data: output } |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
web3: web3VM |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
debugManager.callTree.event.register('callTreeReady', () => { |
|
|
|
|
|
|
|
testDebugging(debugManager) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
debugManager.callTree.event.register('callTreeNotReady', (error) => { |
|
|
|
|
|
|
|
console.error(error) |
|
|
|
|
|
|
|
throw error |
|
|
|
throw error |
|
|
|
}) |
|
|
|
} else { |
|
|
|
debugManager.callTree.event.register('callTreeBuildFailed', (error) => { |
|
|
|
var debugManager = new Debugger({ |
|
|
|
console.error(error) |
|
|
|
compilationResult: function () { |
|
|
|
throw error |
|
|
|
return { data: output } |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
web3: web3VM |
|
|
|
debugManager.debug(tx) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
debugManager.callTree.event.register('callTreeReady', () => { |
|
|
|
} |
|
|
|
testDebugging(debugManager) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
debugManager.callTree.event.register('callTreeNotReady', (error) => { |
|
|
|
|
|
|
|
console.error(error) |
|
|
|
|
|
|
|
throw error |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
debugManager.callTree.event.register('callTreeBuildFailed', (error) => { |
|
|
|
|
|
|
|
console.error(error) |
|
|
|
|
|
|
|
throw error |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
debugManager.debug(tx) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
})() |
|
|
|
|
|
|
|
|
|
|
|
function testDebugging (debugManager) { |
|
|
|
function testDebugging (debugManager) { |
|
|
|
// stack
|
|
|
|
// stack
|
|
|
|