Browse Source

Nicer uncle info.

Fix for fromAscii/toAscii and asBytes usage.
cl-refactor
Gav Wood 10 years ago
parent
commit
d395b82f1b
  1. 7
      alethzero/MainWin.cpp
  2. 4
      libjsqrc/main.js
  3. 2
      libweb3jsonrpc/WebThreeStubServer.cpp

7
alethzero/MainWin.cpp

@ -1243,6 +1243,13 @@ void Main::on_blocks_currentItemChanged()
s << "<br/>Log Bloom: <b>" << info.logBloom << "</b>";
s << "<br/>Transactions: <b>" << block[1].itemCount() << "</b> @<b>" << info.transactionsRoot << "</b>";
s << "<br/>Uncles: <b>" << block[2].itemCount() << "</b> @<b>" << info.sha3Uncles << "</b>";
for (auto u: block[2])
{
BlockInfo uncle = BlockInfo::fromHeader(u.data());
s << "<br/><span style=\"margin-left: 2em\">&nbsp;</span>Hash: <b>" << uncle.hash << "</b>";
s << "<br/><span style=\"margin-left: 2em\">&nbsp;</span>Parent: <b>" << uncle.parentHash << "</b>";
s << "<br/><span style=\"margin-left: 2em\">&nbsp;</span>Number: <b>" << uncle.number << "</b>";
}
if (info.parentHash)
s << "<br/>Pre: <b>" << BlockInfo(ethereum()->blockChain().block(info.parentHash)).stateRoot << "</b>";
else

4
libjsqrc/main.js

@ -217,6 +217,8 @@
// Find termination
var str = "";
var i = 0, l = hex.length;
if (hex.substring(0, 2) == '0x')
i = 2;
for(; i < l; i+=2) {
var code = hex.charCodeAt(i)
if(code == 0) {
@ -238,7 +240,7 @@
var hex = this.toHex(str);
while(hex.length < pad*2)
hex += "00";
return hex
return "0x" + hex
},
eth: {

2
libweb3jsonrpc/WebThreeStubServer.cpp

@ -228,7 +228,7 @@ static shh::Envelope toSealed(Json::Value const& _json, shh::Message const& _m,
if (!_json["topic"].empty())
{
if (_json["topic"].isString())
bt.shift(jsToBytes(_json["topic"]));
bt.shift(jsToBytes(_json["topic"].asString()));
else if (_json["topic"].isArray())
for (auto i: _json["topic"])
bt.shift(jsToBytes(i.asString()));

Loading…
Cancel
Save