diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 7fdb058d8..091e4ce98 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -818,7 +818,7 @@ void Main::on_importKeyFile_triggered() m_myKeys.push_back(KeyPair::create()); keysChanged(); } - ethereum()->transact(k.sec(), ethereum()->balanceAt(k.address()) - gasPrice() * c_txGas, m_myKeys.back().address(), {}, c_txGas, gasPrice()); + ethereum()->submitTransaction(k.sec(), ethereum()->balanceAt(k.address()) - gasPrice() * c_txGas, m_myKeys.back().address(), {}, c_txGas, gasPrice()); } else QMessageBox::warning(this, "Already Have Key", "Could not import the secret key: we already own this account."); diff --git a/alethzero/Transact.cpp b/alethzero/Transact.cpp index a9023b2f2..2c77895ff 100644 --- a/alethzero/Transact.cpp +++ b/alethzero/Transact.cpp @@ -284,7 +284,7 @@ void Transact::on_send_clicked() { // If execution is a contract creation, add Natspec to // a local Natspec LEVELDB - ethereum()->transact(s, value(), m_data, ui->gas->value(), gasPrice()); + ethereum()->submitTransaction(s, value(), m_data, ui->gas->value(), gasPrice()); string src = ui->data->toPlainText().toStdString(); if (sourceIsSolidity(src)) try @@ -304,7 +304,7 @@ void Transact::on_send_clicked() return; } else - ethereum()->transact(s, value(), m_context->fromString(ui->destination->currentText()), m_data, ui->gas->value(), gasPrice()); + ethereum()->submitTransaction(s, value(), m_context->fromString(ui->destination->currentText()), m_data, ui->gas->value(), gasPrice()); return; } QMessageBox::critical(this, "Transaction Failed", "Couldn't make transaction: no single account contains at least the required amount."); diff --git a/eth/main.cpp b/eth/main.cpp index 3b97c561d..81e910716 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -659,7 +659,7 @@ int main(int argc, char** argv) { Secret secret = h256(fromHex(sechex)); Address dest = h160(fromHex(hexAddr)); - c->transact(secret, amount, dest, data, gas, gasPrice); + c->submitTransaction(secret, amount, dest, data, gas, gasPrice); } catch (BadHexCharacter& _e) { @@ -673,7 +673,7 @@ int main(int argc, char** argv) } } else - cwarn << "Require parameters: transact ADDRESS AMOUNT GASPRICE GAS SECRET DATA"; + cwarn << "Require parameters: submitTransaction ADDRESS AMOUNT GASPRICE GAS SECRET DATA"; } else if (c && cmd == "listcontracts") { @@ -721,7 +721,7 @@ int main(int argc, char** argv) try { Address dest = h160(fromHex(hexAddr, ThrowType::Throw)); - c->transact(us.secret(), amount, dest, bytes(), minGas); + c->submitTransaction(us.secret(), amount, dest, bytes(), minGas); } catch (BadHexCharacter& _e) { @@ -790,7 +790,7 @@ int main(int argc, char** argv) else if (gas < minGas) cwarn << "Minimum gas amount is" << minGas; else - c->transact(us.secret(), endowment, init, gas, gasPrice); + c->submitTransaction(us.secret(), endowment, init, gas, gasPrice); } else cwarn << "Require parameters: contract ENDOWMENT GASPRICE GAS CODEHEX"; diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp index 9d7ecb605..4d10679dd 100644 --- a/libethereum/Client.cpp +++ b/libethereum/Client.cpp @@ -475,7 +475,7 @@ void Client::setupState(State& _s) _s.commitToMine(m_bc); } -void Client::transact(Secret _secret, u256 _value, Address _dest, bytes const& _data, u256 _gas, u256 _gasPrice) +void Client::submitTransaction(Secret _secret, u256 _value, Address _dest, bytes const& _data, u256 _gas, u256 _gasPrice) { startWorking(); @@ -539,7 +539,7 @@ bytes Client::call(Address _dest, bytes const& _data, u256 _gas, u256 _value, u2 return bytes(); } -Address Client::transact(Secret _secret, u256 _endowment, bytes const& _init, u256 _gas, u256 _gasPrice) +Address Client::submitTransaction(Secret _secret, u256 _endowment, bytes const& _init, u256 _gas, u256 _gasPrice) { startWorking(); diff --git a/libethereum/Client.h b/libethereum/Client.h index 02d8ef6f8..6048715c4 100644 --- a/libethereum/Client.h +++ b/libethereum/Client.h @@ -212,11 +212,11 @@ public: void setGasPricer(std::shared_ptr _gp) { m_gp = _gp; } /// Submits the given message-call transaction. - virtual void transact(Secret _secret, u256 _value, Address _dest, bytes const& _data = bytes(), u256 _gas = 10000, u256 _gasPrice = 10 * szabo); + virtual void submitTransaction(Secret _secret, u256 _value, Address _dest, bytes const& _data = bytes(), u256 _gas = 10000, u256 _gasPrice = 10 * szabo); /// Submits a new contract-creation transaction. /// @returns the new contract's address (assuming it all goes through). - virtual Address transact(Secret _secret, u256 _endowment, bytes const& _init, u256 _gas = 10000, u256 _gasPrice = 10 * szabo); + virtual Address submitTransaction(Secret _secret, u256 _endowment, bytes const& _init, u256 _gas = 10000, u256 _gasPrice = 10 * szabo); /// Injects the RLP-encoded transaction given by the _rlp into the transaction queue directly. virtual void inject(bytesConstRef _rlp); diff --git a/libethereum/Interface.h b/libethereum/Interface.h index abf7c0a2d..83305af3e 100644 --- a/libethereum/Interface.h +++ b/libethereum/Interface.h @@ -60,11 +60,11 @@ public: // [TRANSACTION API] /// Submits the given message-call transaction. - virtual void transact(Secret _secret, u256 _value, Address _dest, bytes const& _data = bytes(), u256 _gas = 10000, u256 _gasPrice = 10 * szabo) = 0; + virtual void submitTransaction(Secret _secret, u256 _value, Address _dest, bytes const& _data = bytes(), u256 _gas = 10000, u256 _gasPrice = 10 * szabo) = 0; /// Submits a new contract-creation transaction. /// @returns the new contract's address (assuming it all goes through). - virtual Address transact(Secret _secret, u256 _endowment, bytes const& _init, u256 _gas = 10000, u256 _gasPrice = 10 * szabo) = 0; + virtual Address submitTransaction(Secret _secret, u256 _endowment, bytes const& _init, u256 _gas = 10000, u256 _gasPrice = 10 * szabo) = 0; /// Injects the RLP-encoded transaction given by the _rlp into the transaction queue directly. virtual void inject(bytesConstRef _rlp) = 0; diff --git a/libethereumx/Ethereum.cpp b/libethereumx/Ethereum.cpp index d1968b7fa..54b698646 100644 --- a/libethereumx/Ethereum.cpp +++ b/libethereumx/Ethereum.cpp @@ -83,7 +83,7 @@ void Ethereum::connect(std::string const& _seedHost, unsigned short _port) { } -void Ethereum::transact(Secret _secret, u256 _value, Address _dest, bytes const& _data, u256 _gas, u256 _gasPrice) +void Ethereum::submitTransaction(Secret _secret, u256 _value, Address _dest, bytes const& _data, u256 _gas, u256 _gasPrice) { } @@ -92,7 +92,7 @@ bytes Ethereum::call(Secret _secret, u256 _value, Address _dest, bytes const& _d return bytes(); } -Address Ethereum::transact(Secret _secret, u256 _endowment, bytes const& _init, u256 _gas, u256 _gasPrice) +Address Ethereum::submitTransaction(Secret _secret, u256 _endowment, bytes const& _init, u256 _gas, u256 _gasPrice) { return Address(); } diff --git a/libethereumx/Ethereum.h b/libethereumx/Ethereum.h index 517010b93..7ff685339 100644 --- a/libethereumx/Ethereum.h +++ b/libethereumx/Ethereum.h @@ -62,11 +62,11 @@ public: ~Ethereum(); /// Submits the given message-call transaction. - void transact(Secret _secret, u256 _value, Address _dest, bytes const& _data = bytes(), u256 _gas = 10000, u256 _gasPrice = 10 * szabo); + void submitTransaction(Secret _secret, u256 _value, Address _dest, bytes const& _data = bytes(), u256 _gas = 10000, u256 _gasPrice = 10 * szabo); /// Submits a new contract-creation transaction. /// @returns the new contract's address (assuming it all goes through). - Address transact(Secret _secret, u256 _endowment, bytes const& _init, u256 _gas = 10000, u256 _gasPrice = 10 * szabo); + Address submitTransaction(Secret _secret, u256 _endowment, bytes const& _init, u256 _gas = 10000, u256 _gasPrice = 10 * szabo); /// Injects the RLP-encoded transaction given by the _rlp into the transaction queue directly. void inject(bytesConstRef _rlp); diff --git a/libweb3jsonrpc/WebThreeStubServerBase.cpp b/libweb3jsonrpc/WebThreeStubServerBase.cpp index 0434d1e76..76b422a18 100644 --- a/libweb3jsonrpc/WebThreeStubServerBase.cpp +++ b/libweb3jsonrpc/WebThreeStubServerBase.cpp @@ -953,9 +953,9 @@ void WebThreeStubServerBase::authenticate(TransactionSkeleton const& _t, bool _t if (_toProxy) m_accounts->queueTransaction(_t); else if (_t.to) - client()->transact(m_accounts->secretKey(_t.from), _t.value, _t.to, _t.data, _t.gas, _t.gasPrice); + client()->submitTransaction(m_accounts->secretKey(_t.from), _t.value, _t.to, _t.data, _t.gas, _t.gasPrice); else - client()->transact(m_accounts->secretKey(_t.from), _t.value, _t.data, _t.gas, _t.gasPrice); + client()->submitTransaction(m_accounts->secretKey(_t.from), _t.value, _t.data, _t.gas, _t.gasPrice); } void WebThreeStubServerBase::setAccounts(const vector& _accounts) diff --git a/mix/ClientModel.cpp b/mix/ClientModel.cpp index f12bcc1d8..6f3b8c831 100644 --- a/mix/ClientModel.cpp +++ b/mix/ClientModel.cpp @@ -445,13 +445,13 @@ void ClientModel::showDebugError(QString const& _error) Address ClientModel::deployContract(bytes const& _code, TransactionSettings const& _ctrTransaction) { - Address newAddress = m_client->transact(_ctrTransaction.sender, _ctrTransaction.value, _code, _ctrTransaction.gas, _ctrTransaction.gasPrice); + Address newAddress = m_client->submitTransaction(_ctrTransaction.sender, _ctrTransaction.value, _code, _ctrTransaction.gas, _ctrTransaction.gasPrice); return newAddress; } void ClientModel::callContract(Address const& _contract, bytes const& _data, TransactionSettings const& _tr) { - m_client->transact(_tr.sender, _tr.value, _contract, _data, _tr.gas, _tr.gasPrice); + m_client->submitTransaction(_tr.sender, _tr.value, _contract, _data, _tr.gas, _tr.gasPrice); } RecordLogEntry* ClientModel::lastBlock() const diff --git a/mix/MixClient.cpp b/mix/MixClient.cpp index e088a093b..74e8ca9ef 100644 --- a/mix/MixClient.cpp +++ b/mix/MixClient.cpp @@ -247,7 +247,7 @@ State MixClient::asOf(int _block) const return State(m_stateDB, bc(), bc().numberHash(_block)); } -void MixClient::transact(Secret _secret, u256 _value, Address _dest, bytes const& _data, u256 _gas, u256 _gasPrice) +void MixClient::submitTransaction(Secret _secret, u256 _value, Address _dest, bytes const& _data, u256 _gas, u256 _gasPrice) { WriteGuard l(x_state); u256 n = m_state.transactionsFrom(toAddress(_secret)); @@ -255,7 +255,7 @@ void MixClient::transact(Secret _secret, u256 _value, Address _dest, bytes const executeTransaction(t, m_state, false); } -Address MixClient::transact(Secret _secret, u256 _endowment, bytes const& _init, u256 _gas, u256 _gasPrice) +Address MixClient::submitTransaction(Secret _secret, u256 _endowment, bytes const& _init, u256 _gas, u256 _gasPrice) { WriteGuard l(x_state); u256 n = m_state.transactionsFrom(toAddress(_secret)); diff --git a/mix/MixClient.h b/mix/MixClient.h index af5c8ec2b..575871899 100644 --- a/mix/MixClient.h +++ b/mix/MixClient.h @@ -48,8 +48,8 @@ public: ExecutionResults const& executions() const; //dev::eth::Interface - void transact(Secret _secret, u256 _value, Address _dest, bytes const& _data, u256 _gas, u256 _gasPrice) override; - Address transact(Secret _secret, u256 _endowment, bytes const& _init, u256 _gas, u256 _gasPrice) override; + void submitTransaction(Secret _secret, u256 _value, Address _dest, bytes const& _data, u256 _gas, u256 _gasPrice) override; + Address submitTransaction(Secret _secret, u256 _endowment, bytes const& _init, u256 _gas, u256 _gasPrice) override; void inject(bytesConstRef _rlp) override; void flushTransactions() override; bytes call(Secret _secret, u256 _value, Address _dest, bytes const& _data, u256 _gas, u256 _gasPrice, int _blockNumber) override; diff --git a/neth/main.cpp b/neth/main.cpp index 8228f2770..2ce9872ca 100644 --- a/neth/main.cpp +++ b/neth/main.cpp @@ -736,7 +736,7 @@ int main(int argc, char** argv) { Secret secret = h256(fromHex(sechex, ThrowType::Throw)); Address dest = h160(fromHex(fields[0], ThrowType::Throw)); - c->transact(secret, amount, dest, data, gas, gasPrice); + c->submitTransaction(secret, amount, dest, data, gas, gasPrice); } catch (BadHexCharacter& _e) { @@ -787,7 +787,7 @@ int main(int argc, char** argv) try { Address dest = h160(fromHex(fields[0], ThrowType::Throw)); - c->transact(us.secret(), amount, dest, bytes(), minGas); + c->submitTransaction(us.secret(), amount, dest, bytes(), minGas); } catch (BadHexCharacter& _e) { @@ -880,7 +880,7 @@ int main(int argc, char** argv) cwarn << "Minimum gas amount is" << minGas; else { - c->transact(us.secret(), endowment, init, gas); + c->submitTransaction(us.secret(), endowment, init, gas); } } } diff --git a/test/txTest.cpp b/test/txTest.cpp index e2a16e16c..a70a68f01 100644 --- a/test/txTest.cpp +++ b/test/txTest.cpp @@ -49,7 +49,7 @@ BOOST_AUTO_TEST_CASE(mine_local_simple_tx) auto txAmount = c1bal / 2u; auto gasPrice = 10 * szabo; auto gas = dev::eth::c_callGas; - c1.transact(kp1.secret(), txAmount, kp2.address(), bytes(), gas, gasPrice); + c1.submitTransaction(kp1.secret(), txAmount, kp2.address(), bytes(), gas, gasPrice); //mine some more to include the transaction on chain mine(c1, 1); @@ -77,7 +77,7 @@ BOOST_AUTO_TEST_CASE(mine_and_send_to_peer) auto txAmount = c1bal / 2u; auto gasPrice = 10 * szabo; auto gas = dev::eth::c_callGas; - c1.transact(kp1.secret(), txAmount, kp2.address(), bytes(), gas, gasPrice); + c1.submitTransaction(kp1.secret(), txAmount, kp2.address(), bytes(), gas, gasPrice); //mine some more to include the transaction on chain mine(c1, 1); @@ -108,7 +108,7 @@ BOOST_AUTO_TEST_CASE(mine_and_send_to_peer_fee_check) auto txAmount = c1StartBalance / 2u; auto gasPrice = 10 * szabo; auto gas = dev::eth::c_callGas; - c1.transact(kp1.secret(), txAmount, c2.address(), bytes(), gas, gasPrice); + c1.submitTransaction(kp1.secret(), txAmount, c2.address(), bytes(), gas, gasPrice); //mine some more, this time with second client (so he can get fees from first client's tx) mine(c2, 1);