|
@ -237,7 +237,7 @@ void ClientModel::executeSequence(vector<TransactionSettings> const& _sequence, |
|
|
{ |
|
|
{ |
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
|
map<Address, QString> deployedContracts; |
|
|
vector<Address> deployedContracts; |
|
|
onStateReset(); |
|
|
onStateReset(); |
|
|
for (TransactionSettings const& transaction: _sequence) |
|
|
for (TransactionSettings const& transaction: _sequence) |
|
|
{ |
|
|
{ |
|
@ -249,7 +249,7 @@ void ClientModel::executeSequence(vector<TransactionSettings> const& _sequence, |
|
|
TransactionSettings stdTransaction = transaction; |
|
|
TransactionSettings stdTransaction = transaction; |
|
|
stdTransaction.gasAuto = true; |
|
|
stdTransaction.gasAuto = true; |
|
|
Address address = deployContract(stdContractCode, stdTransaction); |
|
|
Address address = deployContract(stdContractCode, stdTransaction); |
|
|
deployedContracts.insert(make_pair(address, transaction.contractId)); |
|
|
deployedContracts.push_back(address); |
|
|
m_stdContractAddresses[stdTransaction.contractId] = address; |
|
|
m_stdContractAddresses[stdTransaction.contractId] = address; |
|
|
m_stdContractNames[address] = stdTransaction.contractId; |
|
|
m_stdContractNames[address] = stdTransaction.contractId; |
|
|
} |
|
|
} |
|
@ -284,13 +284,9 @@ void ClientModel::executeSequence(vector<TransactionSettings> const& _sequence, |
|
|
QVariant value = transaction.parameterValues.value(p->name()); |
|
|
QVariant value = transaction.parameterValues.value(p->name()); |
|
|
if (type->type().type == SolidityType::Type::Address && value.toString().startsWith("<")) |
|
|
if (type->type().type == SolidityType::Type::Address && value.toString().startsWith("<")) |
|
|
{ |
|
|
{ |
|
|
for (auto it = deployedContracts.begin(); it != deployedContracts.end(); ++it) |
|
|
value = value.toString().remove("<").remove(">"); |
|
|
{ |
|
|
QStringList nb = value.toString().split(" - "); |
|
|
if (value.toString().remove("<").remove(">") == it->second) |
|
|
value = QVariant(QString::fromStdString("0x" + toHex(deployedContracts.at(nb.back().toInt()).ref()))); |
|
|
{ |
|
|
|
|
|
value = QVariant(QString::fromStdString(toHex(it->first.ref()))); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
encoder.encode(value, type->type()); |
|
|
encoder.encode(value, type->type()); |
|
|
} |
|
|
} |
|
@ -300,7 +296,7 @@ void ClientModel::executeSequence(vector<TransactionSettings> const& _sequence, |
|
|
bytes param = encoder.encodedData(); |
|
|
bytes param = encoder.encodedData(); |
|
|
contractCode.insert(contractCode.end(), param.begin(), param.end()); |
|
|
contractCode.insert(contractCode.end(), param.begin(), param.end()); |
|
|
Address newAddress = deployContract(contractCode, transaction); |
|
|
Address newAddress = deployContract(contractCode, transaction); |
|
|
deployedContracts.insert(make_pair(newAddress, transaction.contractId)); |
|
|
deployedContracts.push_back(newAddress); |
|
|
auto contractAddressIter = m_contractAddresses.find(transaction.contractId); |
|
|
auto contractAddressIter = m_contractAddresses.find(transaction.contractId); |
|
|
if (contractAddressIter == m_contractAddresses.end() || newAddress != contractAddressIter->second) |
|
|
if (contractAddressIter == m_contractAddresses.end() || newAddress != contractAddressIter->second) |
|
|
{ |
|
|
{ |
|
|