40 ClientTest::ClientTest(
44 std::shared_ptr<GasPricer> _gpForAdoption,
45 std::string
const& _dbPath,
49 Client(_params, _networkID, _host, _gpForAdoption, _dbPath, _forceAction, _limits)
59 BOOST_THROW_EXCEPTION(ChainParamsNotNoProof() <<
errinfo_comment(
"Provided configuration is not well formatted."));
66 BOOST_THROW_EXCEPTION(ChainParamsInvalid() <<
errinfo_comment(
"Provided configuration is not well formatted."));
76 RLP blockRLP(rlpBytes);
95 for (
auto const& t: transactions)
void stopSealing() override
Stop sealing.
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
Block m_working
The state of the client which we're sealing (i.e. it'll have all the rewards added), while we're actually working on it.
void onPostStateChanged()
Called when the post state has changed (i.e.
void modifyTimestamp(u256 const &_timestamp)
dev::eth::Block block(h256 const &_blockHash, PopulationStatistics *o_stats) const
Get the block.
bytesConstRef data() const
The bare data of the RLP.
Block m_postSeal
The state of the client which we're sealing (i.e. it'll have all the rewards added).
The Host class Capabilities should be registered prior to startNetwork, since m_capabilities is not t...
ImportResult import(bytesConstRef _block, bool _isOurs=false)
Import a block into the queue.
bool addBlock(std::string const &_rlp)
std::vector< Transaction > Transactions
Nice name for vector of Transaction.
void reopenChain(ChainParams const &_p, WithExisting _we=WithExisting::Trust)
Reloads the blockchain. Just for debug use.
LastHashes lastHashes() const
Get the last N hashes for a given block. (N is determined by the LastHashes type.) ...
SharedMutex x_preSeal
Lock on m_preSeal.
std::hash for asio::adress
void mineBlocks(unsigned _count)
ChainParams const & chainParams() const
Get information on this chain.
ChainParams loadConfig(std::string const &_json, h256 const &_stateRoot=h256()) const
load config/genesis
virtual Transactions transactions(h256 _blockHash) const override
BlockQueue m_bq
Maintains a list of incoming blocks not yet on the blockchain (to be imported).
ClientTest & asClientTest(Interface &_c)
Active model of a block within the block chain.
bytes fromHex(std::string const &_s, WhenError _throw=WhenError::DontThrow)
BlockChain & bc() override
InterfaceStub methods.
#define DEV_WRITE_GUARDED(MUTEX)
#define DEV_READ_GUARDED(MUTEX)
std::vector< byte > bytes
virtual void onNewBlocks(h256s const &_blocks, h256Hash &io_changed) override
Called on chain changes.
Main API hub for interfacing with Ethereum.
boost::multiprecision::number< boost::multiprecision::cpp_int_backend< 256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void >> u256
void resetCurrent(u256 const &_timestamp=u256(utcTime()))
Sets m_currentBlock to a clean state, (i.e.
Transactions const & pending() const
Get the list of pending transactions.
Main API hub for interfacing with Ethereum.
virtual void onNewBlocks(h256s const &_blocks, h256Hash &io_changed)
Called on chain changes.
LastHashes lastHashes(u256 _currentBlockNumber)
std::string sealEngineName
The chain sealer name: e.g. Ethash, NoProof, BasicAuthority.
boost::error_info< struct tag_comment, std::string > errinfo_comment
Block m_preSeal
The present state of the client.
std::weak_ptr< EthereumHost > m_host
Our Ethereum Host. Don't do anything if we can't lock.
ExecutionResult execute(LastHashes const &_lh, Transaction const &_t, Permanence _p=Permanence::Committed, OnOpFunc const &_onOp=OnOpFunc())
Execute a given transaction.
std::unordered_set< h256 > h256Hash
void startSealing() override
Start sealing.
SharedMutex x_working
Lock on m_working.
std::vector< h256 > h256s
SharedMutex x_postSeal
Lock on m_postSeal.
virtual void setAuthor(Address const &_us) override
Set the block author address.
Class for interpreting Recursive Linear-Prefix Data.
void setChainParams(std::string const &_genesis)