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

Method eth_getBlockByNumber

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

Source from the content-addressed store, hash-verified

398}
399
400Json::Value Eth::eth_getBlockByNumber(string const& _blockNumber, bool _includeTransactions)
401{
402 try
403 {
404 BlockNumber h = jsToBlockNumber(_blockNumber);
405 if (!client()->isKnown(h))
406 return Json::Value(Json::nullValue);
407
408 if (_includeTransactions)
409 return toJson(client()->blockInfo(h), client()->blockDetails(h), client()->uncleHashes(h), client()->transactions(h), client()->sealEngine());
410 else
411 return toJson(client()->blockInfo(h), client()->blockDetails(h), client()->uncleHashes(h), client()->transactionHashes(h), client()->sealEngine());
412 }
413 catch (...)
414 {
415 BOOST_THROW_EXCEPTION(JsonRpcException(Errors::ERROR_RPC_INVALID_PARAMS));
416 }
417}
418
419Json::Value Eth::eth_getTransactionByHash(string const& _transactionHash)
420{

Callers 1

eth_getBlockByNumberIMethod · 0.45

Calls 10

jsToBlockNumberFunction · 0.85
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