MCPcopy Create free account
hub / github.com/LUX-Core/lux / eth_getBlockByHash

Method eth_getBlockByHash

src/cpp-ethereum/libweb3jsonrpc/Eth.cpp:381–398  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

379}
380
381Json::Value Eth::eth_getBlockByHash(string const& _blockHash, bool _includeTransactions)
382{
383 try
384 {
385 h256 h = jsToFixed<32>(_blockHash);
386 if (!client()->isKnown(h))
387 return Json::Value(Json::nullValue);
388
389 if (_includeTransactions)
390 return toJson(client()->blockInfo(h), client()->blockDetails(h), client()->uncleHashes(h), client()->transactions(h), client()->sealEngine());
391 else
392 return toJson(client()->blockInfo(h), client()->blockDetails(h), client()->uncleHashes(h), client()->transactionHashes(h), client()->sealEngine());
393 }
394 catch (...)
395 {
396 BOOST_THROW_EXCEPTION(JsonRpcException(Errors::ERROR_RPC_INVALID_PARAMS));
397 }
398}
399
400Json::Value Eth::eth_getBlockByNumber(string const& _blockNumber, bool _includeTransactions)
401{

Callers 1

eth_getBlockByHashIMethod · 0.45

Calls 9

toJsonFunction · 0.70
ValueClass · 0.50
isKnownMethod · 0.45
blockInfoMethod · 0.45
blockDetailsMethod · 0.45
uncleHashesMethod · 0.45
transactionsMethod · 0.45
sealEngineMethod · 0.45
transactionHashesMethod · 0.45

Tested by

no test coverage detected