|
|
@ -373,7 +373,7 @@ void ClientModel::executeSequence(vector<TransactionSettings> const& _sequence, |
|
|
|
auto contractAddressIter = m_contractAddresses.find(transaction.contractId); |
|
|
|
if (contractAddressIter == m_contractAddresses.end() || newAddress != contractAddressIter->second) |
|
|
|
{ |
|
|
|
QString contractToken = "<" + transaction.contractId + " - " + QString::number(deployedContracts.size() - 1) + ">"; |
|
|
|
QString contractToken = retrieveToken(transaction.contractId, deployedContracts); |
|
|
|
m_contractAddresses[contractToken] = newAddress; |
|
|
|
m_contractNames[newAddress] = contractToken; |
|
|
|
contractAddressesChanged(); |
|
|
@ -382,7 +382,7 @@ void ClientModel::executeSequence(vector<TransactionSettings> const& _sequence, |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
auto contractAddressIter = m_contractAddresses.find(transaction.contractId); |
|
|
|
auto contractAddressIter = m_contractAddresses.find(retrieveToken(transaction.contractId, deployedContracts)); |
|
|
|
if (contractAddressIter == m_contractAddresses.end()) |
|
|
|
{ |
|
|
|
emit runFailed("Contract '" + transaction.contractId + tr(" not deployed.") + "' " + tr(" Cannot call ") + transaction.functionId); |
|
|
@ -425,6 +425,14 @@ QString ClientModel::resolveToken(QString const& _value, vector<Address> const& |
|
|
|
return ret; |
|
|
|
} |
|
|
|
|
|
|
|
QString ClientModel::retrieveToken(QString const& _value, vector<Address> const& _contracts) |
|
|
|
{ |
|
|
|
QString ret = _value; |
|
|
|
if (!_value.startsWith("<") && !_value.endsWith(">")) |
|
|
|
return "<" + _value + " - " + QString::number(_contracts.size() - 1) + ">"; |
|
|
|
return ret; |
|
|
|
} |
|
|
|
|
|
|
|
QString ClientModel::resolveContractName(QString const& _value) |
|
|
|
{ |
|
|
|
QString ret = _value; |
|
|
|