diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index bcdb42c57..c2e3d5c84 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -924,8 +924,8 @@ void Main::readSettings(bool _skipGeometry) { p->readSettings(s); }); - static_cast(ethereum()->gasPricer().get())->setAsk(u256(s.value("askPrice", QString::fromStdString(toString(c_defaultGasPrice))).toString().toStdString())); - static_cast(ethereum()->gasPricer().get())->setBid(u256(s.value("bidPrice", QString::fromStdString(toString(c_defaultGasPrice))).toString().toStdString())); + static_cast(ethereum()->gasPricer().get())->setAsk(u256(s.value("askPrice", QString::fromStdString(toString(DefaultGasPrice))).toString().toStdString())); + static_cast(ethereum()->gasPricer().get())->setBid(u256(s.value("bidPrice", QString::fromStdString(toString(DefaultGasPrice))).toString().toStdString())); ui->upnp->setChecked(s.value("upnp", true).toBool()); ui->forcePublicIP->setText(s.value("forceAddress", "").toString()); diff --git a/alethzero/NameRegNamer.cpp b/alethzero/NameRegNamer.cpp index fd2f054b3..c0ed9b3a5 100644 --- a/alethzero/NameRegNamer.cpp +++ b/alethzero/NameRegNamer.cpp @@ -42,7 +42,7 @@ string NameRegNamer::toName(Address const& _a) const { for (auto const& r: m_registrars) { - string n = abiOut(main()->ethereum()->call(r, abiIn("name(address)", _a)).output); + string n = abiOut(main()->ethereum()->call(Address(1), 0, r, abiIn("name(address)", _a), 1000000, DefaultGasPrice, PendingBlock, FudgeFactor::Lenient).output); if (!n.empty()) return n; } @@ -95,7 +95,8 @@ void NameRegNamer::readSettings(QSettings const& _s) while (!m_registrars.empty()) killRegistrar(m_registrars.back()); - Address a("96d76ae3397b52d9f61215270df65d72358709e3"); + Address a("047cdba9627a8686bb24b3a65d87dab7efa53d31"); + m_registrars.push_back(a); m_filters[a] = main()->installWatch(LogFilter().address(a), [=](LocalisedLogEntries const&){ updateCache(); }); noteKnownChanged(); diff --git a/eth/main.cpp b/eth/main.cpp index 13ef5fc00..b33ee0028 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -109,8 +109,8 @@ void help() /*<< " -B,--block-fees Set the block fee profit in the reference unit e.g. ¢ (default: 15)." << endl << " -e,--ether-price Set the ether price in the reference unit e.g. ¢ (default: 30.679)." << endl << " -P,--priority <0 - 100> Default % priority of a transaction (default: 50)." << endl*/ - << " --ask Set the minimum ask gas price under which no transactions will be mined (default " << toString(c_defaultGasPrice) << " )." << endl - << " --bid Set the bid gas price for to pay for transactions (default " << toString(c_defaultGasPrice) << " )." << endl + << " --ask Set the minimum ask gas price under which no transactions will be mined (default " << toString(DefaultGasPrice) << " )." << endl + << " --bid Set the bid gas price for to pay for transactions (default " << toString(DefaultGasPrice) << " )." << endl << endl << "Client mining:" << endl << " -a,--address Set the coinbase (mining payout) address to addr (default: auto)." << endl @@ -337,8 +337,8 @@ int main(int argc, char** argv) // TransactionPriority priority = TransactionPriority::Medium; // double etherPrice = 30.679; // double blockFees = 15.0; - u256 askPrice = c_defaultGasPrice; - u256 bidPrice = c_defaultGasPrice; + u256 askPrice = DefaultGasPrice; + u256 bidPrice = DefaultGasPrice; // javascript console bool useConsole = false; diff --git a/libethereum/ClientBase.h b/libethereum/ClientBase.h index e5e93e5d1..504fb2dbd 100644 --- a/libethereum/ClientBase.h +++ b/libethereum/ClientBase.h @@ -148,7 +148,7 @@ public: using Interface::addresses; virtual Addresses addresses(BlockNumber _block) const override; virtual u256 gasLimitRemaining() const override; - virtual u256 gasBidPrice() const override { return c_defaultGasPrice; } + virtual u256 gasBidPrice() const override { return DefaultGasPrice; } /// Get the coinbase address virtual Address address() const override; diff --git a/libethereum/GasPricer.h b/libethereum/GasPricer.h index 9a89fe94d..47867fee7 100644 --- a/libethereum/GasPricer.h +++ b/libethereum/GasPricer.h @@ -40,7 +40,7 @@ enum class TransactionPriority Highest = 8 }; -static const u256 c_defaultGasPrice = 50 * shannon; +static const u256 DefaultGasPrice = 50 * shannon; class GasPricer { @@ -68,8 +68,8 @@ public: u256 bid(TransactionPriority = TransactionPriority::Medium) const override { return m_bid; } private: - u256 m_ask = c_defaultGasPrice; - u256 m_bid = c_defaultGasPrice; + u256 m_ask = DefaultGasPrice; + u256 m_bid = DefaultGasPrice; }; } diff --git a/libethereum/Interface.h b/libethereum/Interface.h index 9c109000f..ed9659f3b 100644 --- a/libethereum/Interface.h +++ b/libethereum/Interface.h @@ -71,25 +71,25 @@ public: virtual std::pair submitTransaction(TransactionSkeleton const& _t, Secret const& _secret) = 0; /// Submits the given message-call transaction. - void submitTransaction(Secret const& _secret, u256 const& _value, Address const& _dest, bytes const& _data = bytes(), u256 const& _gas = 10000, u256 const& _gasPrice = c_defaultGasPrice, u256 const& _nonce = UndefinedU256); + void submitTransaction(Secret const& _secret, u256 const& _value, Address const& _dest, bytes const& _data = bytes(), u256 const& _gas = 1000000, u256 const& _gasPrice = DefaultGasPrice, u256 const& _nonce = UndefinedU256); /// Submits a new contract-creation transaction. /// @returns the new contract's address (assuming it all goes through). - Address submitTransaction(Secret const& _secret, u256 const& _endowment, bytes const& _init, u256 const& _gas = 10000, u256 const& _gasPrice = c_defaultGasPrice, u256 const& _nonce = UndefinedU256); + Address submitTransaction(Secret const& _secret, u256 const& _endowment, bytes const& _init, u256 const& _gas = 1000000, u256 const& _gasPrice = DefaultGasPrice, u256 const& _nonce = UndefinedU256); /// Blocks until all pending transactions have been processed. virtual void flushTransactions() = 0; /// Makes the given call. Nothing is recorded into the state. virtual ExecutionResult call(Address const& _from, u256 _value, Address _dest, bytes const& _data, u256 _gas, u256 _gasPrice, BlockNumber _blockNumber, FudgeFactor _ff = FudgeFactor::Strict) = 0; - ExecutionResult call(Address const& _from, u256 _value, Address _dest, bytes const& _data = bytes(), u256 _gas = 10000, u256 _gasPrice = c_defaultGasPrice, FudgeFactor _ff = FudgeFactor::Strict) { return call(_from, _value, _dest, _data, _gas, _gasPrice, m_default, _ff); } + ExecutionResult call(Address const& _from, u256 _value, Address _dest, bytes const& _data = bytes(), u256 _gas = 1000000, u256 _gasPrice = DefaultGasPrice, FudgeFactor _ff = FudgeFactor::Strict) { return call(_from, _value, _dest, _data, _gas, _gasPrice, m_default, _ff); } ExecutionResult call(Secret const& _secret, u256 _value, Address _dest, bytes const& _data, u256 _gas, u256 _gasPrice, BlockNumber _blockNumber, FudgeFactor _ff = FudgeFactor::Strict) { return call(toAddress(_secret), _value, _dest, _data, _gas, _gasPrice, _blockNumber, _ff); } ExecutionResult call(Secret const& _secret, u256 _value, Address _dest, bytes const& _data, u256 _gas, u256 _gasPrice, FudgeFactor _ff = FudgeFactor::Strict) { return call(toAddress(_secret), _value, _dest, _data, _gas, _gasPrice, _ff); } /// Does the given creation. Nothing is recorded into the state. /// @returns the pair of the Address of the created contract together with its code. virtual ExecutionResult create(Address const& _from, u256 _value, bytes const& _data, u256 _gas, u256 _gasPrice, BlockNumber _blockNumber, FudgeFactor _ff = FudgeFactor::Strict) = 0; - ExecutionResult create(Address const& _from, u256 _value, bytes const& _data = bytes(), u256 _gas = 10000, u256 _gasPrice = c_defaultGasPrice, FudgeFactor _ff = FudgeFactor::Strict) { return create(_from, _value, _data, _gas, _gasPrice, m_default, _ff); } + ExecutionResult create(Address const& _from, u256 _value, bytes const& _data = bytes(), u256 _gas = 1000000, u256 _gasPrice = DefaultGasPrice, FudgeFactor _ff = FudgeFactor::Strict) { return create(_from, _value, _data, _gas, _gasPrice, m_default, _ff); } ExecutionResult create(Secret const& _secret, u256 _value, bytes const& _data, u256 _gas, u256 _gasPrice, BlockNumber _blockNumber, FudgeFactor _ff = FudgeFactor::Strict) { return create(toAddress(_secret), _value, _data, _gas, _gasPrice, _blockNumber, _ff); } ExecutionResult create(Secret const& _secret, u256 _value, bytes const& _data, u256 _gas, u256 _gasPrice, FudgeFactor _ff = FudgeFactor::Strict) { return create(toAddress(_secret), _value, _data, _gas, _gasPrice, _ff); } diff --git a/libethereumx/Ethereum.h b/libethereumx/Ethereum.h index 73392ea88..50eab0de3 100644 --- a/libethereumx/Ethereum.h +++ b/libethereumx/Ethereum.h @@ -62,11 +62,11 @@ public: ~Ethereum(); /// Submits the given message-call transaction. - void submitTransaction(Secret const& _secret, u256 _value, Address _dest, bytes const& _data = bytes(), u256 _gas = 10000, u256 _gasPrice = c_defaultGasPrice); + void submitTransaction(Secret const& _secret, u256 _value, Address _dest, bytes const& _data = bytes(), u256 _gas = 10000, u256 _gasPrice = DefaultGasPrice); /// Submits a new contract-creation transaction. /// @returns the new contract's address (assuming it all goes through). - Address submitTransaction(Secret const& _secret, u256 _endowment, bytes const& _init, u256 _gas = 10000, u256 _gasPrice = c_defaultGasPrice); + Address submitTransaction(Secret const& _secret, u256 _endowment, bytes const& _init, u256 _gas = 10000, u256 _gasPrice = DefaultGasPrice); /// Injects the RLP-encoded transaction given by the _rlp into the transaction queue directly. void inject(bytesConstRef _rlp); @@ -75,7 +75,7 @@ public: void flushTransactions(); /// Makes the given call. Nothing is recorded into the state. - bytes call(Address const& _from, u256 _value, Address _dest, bytes const& _data = bytes(), u256 _gas = 10000, u256 _gasPrice = c_defaultGasPrice); + bytes call(Address const& _from, u256 _value, Address _dest, bytes const& _data = bytes(), u256 _gas = 10000, u256 _gasPrice = DefaultGasPrice); // Informational stuff diff --git a/test/libethereum/gaspricer.cpp b/test/libethereum/gaspricer.cpp index f5a6b50be..8f54b05ea 100644 --- a/test/libethereum/gaspricer.cpp +++ b/test/libethereum/gaspricer.cpp @@ -55,13 +55,13 @@ BOOST_AUTO_TEST_CASE(trivialGasPricer) { cnote << "trivialGasPricer"; std::shared_ptr gp(new TrivialGasPricer); - BOOST_CHECK_EQUAL(gp->ask(Block()), c_defaultGasPrice); - BOOST_CHECK_EQUAL(gp->bid(), c_defaultGasPrice); + BOOST_CHECK_EQUAL(gp->ask(Block()), DefaultGasPrice); + BOOST_CHECK_EQUAL(gp->bid(), DefaultGasPrice); bytes bl = CanonBlockChain::createGenesisBlock(); gp->update(FullBlockChain(bl, AccountMap(), TransientDirectory().path(), WithExisting::Kill)); - BOOST_CHECK_EQUAL(gp->ask(Block()), c_defaultGasPrice); - BOOST_CHECK_EQUAL(gp->bid(), c_defaultGasPrice); + BOOST_CHECK_EQUAL(gp->ask(Block()), DefaultGasPrice); + BOOST_CHECK_EQUAL(gp->bid(), DefaultGasPrice); } BOOST_AUTO_TEST_CASE(basicGasPricerNoUpdate)