Merge branch 'develop' into new_jsonrpc

Conflicts:
	libweb3jsonrpc/WebThreeStubServerBase.cpp
This commit is contained in:
Marek Kotewicz 2015-03-07 11:10:21 +01:00
commit dab392876a
2 changed files with 8 additions and 7 deletions

View File

@ -87,6 +87,7 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin)
// get txs // get txs
TransactionQueue txs; TransactionQueue txs;
GasPricer gp(10000);
BOOST_REQUIRE(blObj.count("transactions")); BOOST_REQUIRE(blObj.count("transactions"));
for (auto const& txObj: blObj["transactions"].get_array()) for (auto const& txObj: blObj["transactions"].get_array())
{ {
@ -131,7 +132,7 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin)
try try
{ {
state.sync(bc); state.sync(bc);
state.sync(bc,txs); state.sync(bc, txs, gp);
state.commitToMine(bc); state.commitToMine(bc);
MineInfo info; MineInfo info;
for (info.completed = false; !info.completed; info = state.mine()) {} for (info.completed = false; !info.completed; info = state.mine()) {}
@ -281,7 +282,7 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin)
BlockInfo blockHeaderFromFields; BlockInfo blockHeaderFromFields;
const bytes c_rlpBytesBlockHeader = createBlockRLPFromFields(tObj); const bytes c_rlpBytesBlockHeader = createBlockRLPFromFields(tObj);
const RLP c_blockHeaderRLP(c_rlpBytesBlockHeader); const RLP c_blockHeaderRLP(c_rlpBytesBlockHeader);
blockHeaderFromFields.populateFromHeader(c_blockHeaderRLP, false); blockHeaderFromFields.populateFromHeader(c_blockHeaderRLP, IgnoreNonce);
BlockInfo blockFromRlp = bc.info(); BlockInfo blockFromRlp = bc.info();
@ -381,7 +382,7 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin)
BlockInfo uncleBlockHeader; BlockInfo uncleBlockHeader;
try try
{ {
uncleBlockHeader.populateFromHeader(c_uRLP, true); uncleBlockHeader.populateFromHeader(c_uRLP);
} }
catch(...) catch(...)
{ {
@ -395,7 +396,7 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin)
for (auto const& uRLP: root[2]) for (auto const& uRLP: root[2])
{ {
BlockInfo uBl; BlockInfo uBl;
uBl.populateFromHeader(uRLP, true); uBl.populateFromHeader(uRLP);
uBlHsFromRlp.push_back(uBl); uBlHsFromRlp.push_back(uBl);
} }
@ -538,7 +539,7 @@ void overwriteBlockHeader(BlockInfo& _current_BlockHeader, mObject& _blObj)
// take the blockheader as is // take the blockheader as is
const bytes c_blockRLP = createBlockRLPFromFields(_blObj["blockHeader"].get_obj()); const bytes c_blockRLP = createBlockRLPFromFields(_blObj["blockHeader"].get_obj());
const RLP c_bRLP(c_blockRLP); const RLP c_bRLP(c_blockRLP);
_current_BlockHeader.populateFromHeader(c_bRLP, false); _current_BlockHeader.populateFromHeader(c_bRLP, IgnoreNonce);
} }
} }
@ -551,7 +552,7 @@ BlockInfo constructBlock(mObject& _o)
// construct genesis block // construct genesis block
const bytes c_blockRLP = createBlockRLPFromFields(_o); const bytes c_blockRLP = createBlockRLPFromFields(_o);
const RLP c_bRLP(c_blockRLP); const RLP c_bRLP(c_blockRLP);
ret.populateFromHeader(c_bRLP, false); ret.populateFromHeader(c_bRLP, IgnoreNonce);
} }
catch (Exception const& _e) catch (Exception const& _e)
{ {

View File

@ -55,7 +55,7 @@ BOOST_AUTO_TEST_CASE(basic_test)
cnote << i.first; cnote << i.first;
js::mObject& o = i.second.get_obj(); js::mObject& o = i.second.get_obj();
vector<pair<string, string>> ss; vector<pair<string, string>> ss;
BlockInfo header = BlockInfo::fromHeader(fromHex(o["header"].get_str())); BlockInfo header = BlockInfo::fromHeader(fromHex(o["header"].get_str()), CheckNothing);
h256 headerHash(o["header_hash"].get_str()); h256 headerHash(o["header_hash"].get_str());
Nonce nonce(o["nonce"].get_str()); Nonce nonce(o["nonce"].get_str());
BOOST_REQUIRE_EQUAL(headerHash, header.headerHash(WithoutNonce)); BOOST_REQUIRE_EQUAL(headerHash, header.headerHash(WithoutNonce));