| 379 | } |
| 380 | |
| 381 | Json::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 | |
| 400 | Json::Value Eth::eth_getBlockByNumber(string const& _blockNumber, bool _includeTransactions) |
| 401 | { |
no test coverage detected