36 namespace dev {
namespace test {
94 u256 _expectedAsk = 155632494086;
95 u256 _expectedBid = 155633980282;
96 dev::test::executeGasPricerTest(
"RPC_API_Test", 30.679, 15.0,
"/BlockchainTests/bcRPC_API_Test.json", TransactionPriority::Medium, _expectedAsk, _expectedBid, eth::Network::FrontierTest);
101 u256 _expectedAsk = 155633980282;
102 u256 _expectedBid = 155633980282;
103 dev::test::executeGasPricerTest(
"RPC_API_Test", 30.679, 15.0,
"/BlockchainTests/Homestead/bcRPC_API_Test.json", TransactionPriority::Medium, _expectedAsk, _expectedBid, eth::Network::HomesteadTest);
113 u256 _expectedAsk = 155632494086;
114 u256 _expectedBid = 1;
115 dev::test::executeGasPricerTest(
"twoUncle", 30.679, 15.0,
"/BlockchainTests/bcUncleTest.json", TransactionPriority::Medium, _expectedAsk, _expectedBid, eth::Network::FrontierTest);
120 u256 _expectedAsk = 155633980282;
121 u256 _expectedBid = 1;
122 dev::test::executeGasPricerTest(
"twoUncle", 30.679, 15.0,
"/BlockchainTests/Homestead/bcUncleTest.json", TransactionPriority::Medium, _expectedAsk, _expectedBid, eth::Network::HomesteadTest);
127 u256 _expectedAsk = 155632494086;
128 u256 _expectedBid = 1;
129 dev::test::executeGasPricerTest(
"correct", 30.679, 15.0,
"/BlockchainTests/bcUncleHeaderValiditiy.json", TransactionPriority::Medium, _expectedAsk, _expectedBid, eth::Network::FrontierTest);
134 u256 _expectedAsk = 155633980282;
135 u256 _expectedBid = 1;
136 dev::test::executeGasPricerTest(
"correct", 30.679, 15.0,
"/BlockchainTests/Homestead/bcUncleHeaderValiditiy.json", TransactionPriority::Medium, _expectedAsk, _expectedBid, eth::Network::HomesteadTest);
141 u256 _expectedAsk = 155632494086;
142 u256 _expectedBid = 155632494086;
143 dev::test::executeGasPricerTest(
"notxs", 30.679, 15.0,
"/BlockchainTests/bcGasPricerTest.json", TransactionPriority::Medium, _expectedAsk, _expectedBid, eth::Network::FrontierTest);
148 u256 _expectedAsk = 155633980282;
149 u256 _expectedBid = 155633980282;
150 dev::test::executeGasPricerTest(
"notxs", 30.679, 15.0,
"/BlockchainTests/Homestead/bcGasPricerTest.json", TransactionPriority::Medium, _expectedAsk, _expectedBid, eth::Network::HomesteadTest);
155 u256 _expectedAsk = 15731282021;
156 u256 _expectedBid = 10000000000000;
157 dev::test::executeGasPricerTest(
"highGasUsage", 30.679, 15.0,
"/BlockchainTests/bcGasPricerTest.json", TransactionPriority::Lowest, _expectedAsk, _expectedBid, eth::Network::FrontierTest);
162 u256 _expectedAsk = 15731282021;
163 u256 _expectedBid = 15734152261884;
164 dev::test::executeGasPricerTest(
"highGasUsage", 30.679, 15.0,
"/BlockchainTests/bcGasPricerTest.json", TransactionPriority::Low, _expectedAsk, _expectedBid, eth::Network::FrontierTest);
169 u256 _expectedAsk = 15731282021;
170 u256 _expectedBid = 20000000000000;
171 dev::test::executeGasPricerTest(
"highGasUsage", 30.679, 15.0,
"/BlockchainTests/bcGasPricerTest.json", TransactionPriority::Medium, _expectedAsk, _expectedBid, eth::Network::FrontierTest);
176 u256 _expectedAsk = 15731282021;
177 u256 _expectedBid = 24265847738115;
178 dev::test::executeGasPricerTest(
"highGasUsage", 30.679, 15.0,
"/BlockchainTests/bcGasPricerTest.json", TransactionPriority::High, _expectedAsk, _expectedBid, eth::Network::FrontierTest);
183 u256 _expectedAsk = 15731282021;
184 u256 _expectedBid = 30000000000000;
185 dev::test::executeGasPricerTest(
"highGasUsage", 30.679, 15.0,
"/BlockchainTests/bcGasPricerTest.json", TransactionPriority::Highest, _expectedAsk, _expectedBid, eth::Network::FrontierTest);
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
void executeGasPricerTest(string const &name, double _etherPrice, double _blockFee, string const &bcTestPath, TransactionPriority _txPrio, u256 _expectedAsk, u256 _expectedBid, eth::Network _sealEngineNetwork=eth::Network::TransitionnetTest)
Json::Value loadJsonFromFile(std::string const &_path)
BOOST_AUTO_TEST_CASE(trivialGasPricer)
#define BOOST_CHECK_THROW(stmt, excMatch)
Implements the blockchain database.
eth::BlockChain const & bc() const
u256 ask(Block const &) const override
std::hash for asio::adress
Active model of a block within the block chain.
void update(BlockChain const &_bc) override
Should be used to load test blockchain from json file Loads the blockchain from json, creates temporary directory to store it, removes the directory on dealloc.
std::string getTestPath()
boost::multiprecision::number< boost::multiprecision::cpp_int_backend< 256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void >> u256
#define BOOST_FIXTURE_TEST_SUITE(a, b)
#define BOOST_CHECK_EQUAL(v1, v2)
u256 bid(TransactionPriority _p=TransactionPriority::Medium) const override
#define BOOST_AUTO_TEST_SUITE_END()
void setRefPrice(u256 _weiPerRef)
temporary directory implementation It creates temporary directory in the given path.
Helper functions to work with json::spirit and test files.
#define BOOST_CHECK(expr)
void setRefBlockFees(u256 _refsPerBlock)