Browse Source

bug fix calling contract during deployment

cl-refactor
DEV Mac Mini 10 years ago
parent
commit
ae2a3b477b
  1. 10
      mix/qml/js/NetworkDeployment.js

10
mix/qml/js/NetworkDeployment.js

@ -157,7 +157,13 @@ function executeTr(blockIndex, trIndex, state, ctrAddresses, trHashes, callBack)
if (tr.contractId === tr.functionId)
rpcParams.code = codeModel.contracts[tr.contractId].codeHex + encodedParams.join("");
else
rpcParams.data = "0x" + func.qhash() + encodedParams.join("");
{
rpcParams.data = "0x" + func.qhash() + encodedParams.join("");
console.log(tr.contractId)
console.log(JSON.stringify(ctrAddresses))
rpcParams.to = ctrAddresses[tr.contractId];
}
var requests = [{
jsonrpc: "2.0",
@ -180,7 +186,7 @@ function executeTr(blockIndex, trIndex, state, ctrAddresses, trHashes, callBack)
if (tr.contractId === tr.functionId)
{
ctrAddresses[tr.contractId] = receipt.contractAddress
ctrAddresses[tr.contractId + " - " + trIndex] = receipt.contractAddress //get right ctr address if deploy more than one contract of same type.
ctrAddresses["<" + tr.contractId + " - " + trIndex + ">"] = receipt.contractAddress //get right ctr address if deploy more than one contract of same type.
}
executeTrNextStep(blockIndex, trIndex, state, ctrAddresses, trHashes, callBack)
}

Loading…
Cancel
Save