|
@ -387,24 +387,21 @@ void ClientModel::executeSequence(vector<TransactionSettings> const& _sequence, |
|
|
|
|
|
|
|
|
std::pair<QString, int> ClientModel::resolvePair(QString const& _contractId) |
|
|
std::pair<QString, int> ClientModel::resolvePair(QString const& _contractId) |
|
|
{ |
|
|
{ |
|
|
std::pair<QString, int> ret; |
|
|
std::pair<QString, int> ret = std::make_pair(_contractId, 0); |
|
|
ret.first = _contractId; |
|
|
|
|
|
ret.second = -1; |
|
|
|
|
|
if (_contractId.startsWith("<") && _contractId.endsWith(">")) |
|
|
if (_contractId.startsWith("<") && _contractId.endsWith(">")) |
|
|
{ |
|
|
{ |
|
|
QStringList values = ret.first.remove("<").remove(">").split(" - "); |
|
|
QStringList values = ret.first.remove("<").remove(">").split(" - "); |
|
|
ret.first = values[0]; |
|
|
ret = std::make_pair(values[0], values[1].toUInt()); |
|
|
ret.second = values[1].toUInt(); |
|
|
|
|
|
} |
|
|
} |
|
|
return ret; |
|
|
return ret; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
QString ClientModel::resolveToken(std::pair<QString, int> const& _value, vector<Address> const& _contracts) |
|
|
QString ClientModel::resolveToken(std::pair<QString, int> const& _value, vector<Address> const& _contracts) |
|
|
{ |
|
|
{ |
|
|
if (_value.second != -1) |
|
|
if (_contracts.size() > 0) |
|
|
return QString::fromStdString("0x" + dev::toHex(_contracts.at(_value.second).ref())); |
|
|
return QString::fromStdString("0x" + dev::toHex(_contracts.at(_value.second).ref())); |
|
|
else |
|
|
else |
|
|
return _value.first; |
|
|
return _value.first; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
std::pair<QString, int> ClientModel::retrieveToken(QString const& _value, vector<Address> const& _contracts) |
|
|
std::pair<QString, int> ClientModel::retrieveToken(QString const& _value, vector<Address> const& _contracts) |
|
|