static Json::Value toJson(dev::eth::Transaction const& _t)
{
	Json::Value res;
	res["hash"] = toJS(_t.sha3());
	res["input"] = jsFromBinary(_t.data());
	res["to"] = toJS(_t.receiveAddress());
	res["from"] = toJS(_t.safeSender());
	res["gas"] = (int)_t.gas();
	res["gasPrice"] = toJS(_t.gasPrice());
	res["nonce"] = toJS(_t.nonce());
	res["value"] = toJS(_t.value());
	return res;
}
Пример #2
0
Json::Value toJson(dev::eth::Transaction const& _t, std::pair<h256, unsigned> _location, BlockNumber _blockNumber)
{
    Json::Value res;
    if (_t)
    {
        res["hash"] = toJS(_t.sha3());
        res["input"] = toJS(_t.data());
        res["to"] = _t.isCreation() ? Json::Value() : toJS(_t.receiveAddress());
        res["from"] = toJS(_t.safeSender());
        res["gas"] = toJS(_t.gas());
        res["gasPrice"] = toJS(_t.gasPrice());
        res["nonce"] = toJS(_t.nonce());
        res["value"] = toJS(_t.value());
        res["blockHash"] = toJS(_location.first);
        res["transactionIndex"] = toJS(_location.second);
        res["blockNumber"] = toJS(_blockNumber);
    }
    return res;
}
Пример #3
0
Json::Value toJson(dev::eth::Transaction const& _t)
{
    Json::Value res;
    res["to"] = _t.isCreation() ? Json::Value() : toJS(_t.to());
    res["from"] = toJS(_t.from());
    res["gas"] = toJS(_t.gas());
    res["gasPrice"] = toJS(_t.gasPrice());
    res["value"] = toJS(_t.value());
    res["data"] = toJS(_t.data(), 32);
    res["nonce"] = toJS(_t.nonce());
    res["hash"] = toJS(_t.sha3(WithSignature));
    res["sighash"] = toJS(_t.sha3(WithoutSignature));
    res["r"] = toJS(_t.signature().r);
    res["s"] = toJS(_t.signature().s);
    res["v"] = toJS(_t.signature().v);
    return res;
}