private void verifyBlockResult(
      final Block block,
      final Difficulty td,
      final JsonObject result,
      final boolean shouldTransactionsBeHashed) {
    assertBlockResultMatchesBlock(result, block);

    if (td == null) {
      assertThat(result.getJsonObject("totalDifficulty")).isNull();
    } else {
      assertThat(Difficulty.fromHexString(result.getString("totalDifficulty"))).isEqualTo(td);
    }

    // Check ommers
    final JsonArray ommersResult = result.getJsonArray("uncles");
    assertThat(ommersResult.size()).isEqualTo(block.getBody().getOmmers().size());
    for (int i = 0; i < block.getBody().getOmmers().size(); i++) {
      final BlockHeader ommer = block.getBody().getOmmers().get(i);
      final Hash ommerHash = ommer.getHash();
      assertThat(Hash.fromHexString(ommersResult.getString(i))).isEqualTo(ommerHash);
    }

    // Check transactions
    final JsonArray transactionsResult = result.getJsonArray("transactions");
    assertThat(transactionsResult.size()).isEqualTo(block.getBody().getTransactions().size());
    for (int i = 0; i < block.getBody().getTransactions().size(); i++) {
      final Transaction transaction = block.getBody().getTransactions().get(i);
      if (shouldTransactionsBeHashed) {
        assertThat(Hash.fromHexString(transactionsResult.getString(i)))
            .isEqualTo(transaction.getHash());
      } else {
        final JsonObject transactionResult = transactionsResult.getJsonObject(i);
        final Integer expectedIndex = i;
        final Hash expectedBlockHash = block.getHeader().getHash();
        final long expectedBlockNumber = block.getHeader().getNumber();
        assertTransactionResultMatchesTransaction(
            transactionResult,
            transaction,
            expectedIndex,
            expectedBlockHash,
            block.getHeader().getBaseFee(),
            expectedBlockNumber);
      }
    }
  }
Tests that empty batch requests are treated as invalid requests as per
http://www.jsonrpc.org/specification#batch.
ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTest.java