Beispiel #1
0
Json::Value toJson(dev::eth::BlockHeader const& _bi, SealEngineFace* _sealer)
{
    Json::Value res;
    if (_bi)
    {
        DEV_IGNORE_EXCEPTIONS(res["hash"] = toJS(_bi.hash()));
        res["parentHash"] = toJS(_bi.parentHash());
        res["sha3Uncles"] = toJS(_bi.sha3Uncles());
        res["author"] = toJS(_bi.author());
        res["stateRoot"] = toJS(_bi.stateRoot());
        res["transactionsRoot"] = toJS(_bi.transactionsRoot());
        res["receiptsRoot"] = toJS(_bi.receiptsRoot());
        res["number"] = toJS(_bi.number());
        res["gasUsed"] = toJS(_bi.gasUsed());
        res["gasLimit"] = toJS(_bi.gasLimit());
        res["extraData"] = toJS(_bi.extraData());
        res["logsBloom"] = toJS(_bi.logBloom());
        res["timestamp"] = toJS(_bi.timestamp());
        // TODO: remove once JSONRPC spec is updated to use "author" over "miner".
        res["miner"] = toJS(_bi.author());
        if (_sealer)
            for (auto const& i: _sealer->jsInfo(_bi))
                res[i.first] = i.second;

    }
    return res;
}
Beispiel #2
0
void badBlock(bytesConstRef _block, string const& _err)
{
    BlockInfo bi;
    DEV_IGNORE_EXCEPTIONS(bi = BlockInfo(_block, CheckNothing));
    badBlockInfo(bi, _err);
}
Beispiel #3
0
void badBlock(bytesConstRef _block, string const& _err)
{
	BlockHeader bi;
	DEV_IGNORE_EXCEPTIONS(bi = BlockHeader(_block));
	badBlockInfo(bi, _err);
}