|
|
|
@ -15,12 +15,12 @@ var helper = require('./helper') |
|
|
|
|
module.exports = function (st, vm, privateKey, contractBytecode, compilationResult, cb) { |
|
|
|
|
vmCall.sendTx(vm, { nonce: 0, privateKey: privateKey }, null, 0, contractBytecode, function (error, txHash) { |
|
|
|
|
if (error) { |
|
|
|
|
st.fail(error) |
|
|
|
|
} else { |
|
|
|
|
return st.fail(error) |
|
|
|
|
} |
|
|
|
|
vm.web3.eth.getTransaction(txHash, function (error, tx) { |
|
|
|
|
if (error) { |
|
|
|
|
st.fail(error) |
|
|
|
|
} else { |
|
|
|
|
return st.fail(error) |
|
|
|
|
} |
|
|
|
|
tx.to = traceHelper.contractCreationToken('0') |
|
|
|
|
var traceManager = new TraceManager({ web3: vm.web3 }) |
|
|
|
|
var codeManager = new CodeManager(traceManager) |
|
|
|
@ -44,6 +44,7 @@ module.exports = function (st, vm, privateKey, contractBytecode, compilationResu |
|
|
|
|
st.equals(functions1.length, 1) |
|
|
|
|
st.equals(functions2.length, 2) |
|
|
|
|
st.equals(functions3.length, 0) |
|
|
|
|
|
|
|
|
|
st.equals(Object.keys(functions1[0])[0], 'functionDefinition') |
|
|
|
|
st.equals(Object.keys(functions1[0])[1], 'inputs') |
|
|
|
|
st.equals(functions1[0].inputs[0], 'foo') |
|
|
|
@ -123,9 +124,7 @@ module.exports = function (st, vm, privateKey, contractBytecode, compilationResu |
|
|
|
|
}).catch((error) => { |
|
|
|
|
st.fail(error) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|