diff --git a/mix/ClientModel.cpp b/mix/ClientModel.cpp index e7e8811a3..23f68996c 100644 --- a/mix/ClientModel.cpp +++ b/mix/ClientModel.cpp @@ -390,8 +390,7 @@ void ClientModel::executeSequence(vector const& _sequence) { bytes param = encoder.encodedData(); contractCode.insert(contractCode.end(), param.begin(), param.end()); - deployContract(contractCode, transaction); - Address newAddress = m_client->lastCreatedContractAddr(); + Address newAddress = deployContract(contractCode, transaction); std::pair contractToken = retrieveToken(transaction.contractId); m_contractAddresses[contractToken] = newAddress; m_contractNames[newAddress] = contractToken.first; @@ -673,9 +672,10 @@ void ClientModel::debugRecord(unsigned _index) showDebuggerForTransaction(e); } -void ClientModel::deployContract(bytes const& _code, TransactionSettings const& _ctrTransaction) +Address ClientModel::deployContract(bytes const& _code, TransactionSettings const& _ctrTransaction) { m_client->submitTransaction(_ctrTransaction.sender, _ctrTransaction.value, _code, _ctrTransaction.gas, _ctrTransaction.gasPrice, _ctrTransaction.gasAuto); + return m_client->lastCreatedContractAddr(); } void ClientModel::callAddress(Address const& _contract, bytes const& _data, TransactionSettings const& _tr) diff --git a/mix/ClientModel.h b/mix/ClientModel.h index 66a14ad5b..ca8c36b79 100644 --- a/mix/ClientModel.h +++ b/mix/ClientModel.h @@ -252,7 +252,7 @@ private: QVariantMap contractAddresses() const; QVariantList gasCosts() const; void executeSequence(std::vector const& _sequence); - void deployContract(bytes const& _code, TransactionSettings const& _tr = TransactionSettings()); + Address deployContract(bytes const& _code, TransactionSettings const& _tr = TransactionSettings()); void callAddress(Address const& _contract, bytes const& _data, TransactionSettings const& _tr); void onNewTransaction(); void onStateReset();