From de170a00ed7b62925e2f49350eecf3ec99f65cce Mon Sep 17 00:00:00 2001 From: kourin Date: Fri, 10 Jan 2025 23:03:01 +0900 Subject: [PATCH] Add unit test for GetBlockReceipt JSON-RPC API --- internal/ethapi/celo_block_receipt_test.go | 179 +++++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100644 internal/ethapi/celo_block_receipt_test.go diff --git a/internal/ethapi/celo_block_receipt_test.go b/internal/ethapi/celo_block_receipt_test.go new file mode 100644 index 0000000000..bf3a4311d0 --- /dev/null +++ b/internal/ethapi/celo_block_receipt_test.go @@ -0,0 +1,179 @@ +package ethapi + +import ( + "context" + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/consensus/beacon" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +// TestGetBlockReceipt tests the GetBlockReceipt JSON-RPC API +// This test saves actual block data to the database and retrieves the block receipt using the API +func TestGetBlockReceipt(t *testing.T) { + t.Parallel() + + var ( + genBlocks = 0 + genesis = &core.Genesis{ + Config: params.MergedTestChainConfig, + ExcessBlobGas: new(uint64), + BlobGasUsed: new(uint64), + Alloc: types.GenesisAlloc{}, + } + backend = newTestBackend(t, genBlocks, genesis, beacon.New(ethash.NewFaker()), func(i int, b *core.BlockGen) {}) + api = NewBlockChainAPI(backend) + ) + + seedData := func(t *testing.T, blockHash common.Hash, height uint64, headerBytes []byte, bodyBytes []byte, receiptsBytes []byte) { + t.Helper() + + blockHeader := new(types.Header) + err := rlp.DecodeBytes(headerBytes, blockHeader) + require.NoError(t, err) + + blockBody := new(types.Body) + err = rlp.DecodeBytes(bodyBytes, blockBody) + require.NoError(t, err) + + receipts := types.Receipts{} + err = rlp.DecodeBytes(receiptsBytes, &receipts) + require.NoError(t, err) + + block := types.NewBlockWithHeader(blockHeader).WithBody(*blockBody) + + rawdb.WriteHeaderNumber(backend.ChainDb(), blockHash, height) + rawdb.WriteBlock(backend.ChainDb(), block) + rawdb.WriteReceipts(backend.ChainDb(), blockHash, height, receipts) + + t.Cleanup(func() { + rawdb.DeleteReceipts(backend.ChainDb(), blockHash, height) + rawdb.DeleteBlock(backend.ChainDb(), blockHash, height) + rawdb.DeleteHeaderNumber(backend.ChainDb(), blockHash) + }) + } + + createBlockReceiptBloom := func(logs []*types.Log) types.Bloom { + receipt := &types.Receipt{ + Type: types.LegacyTxType, + PostState: []byte{}, + CumulativeGasUsed: 0, + Logs: logs, + } + + return types.CreateBloom(types.Receipts{receipt}) + } + + createExpectedResponse := func(blockHash common.Hash, blockNumber uint64, receiptIndex int, logs []*types.Log) map[string]interface{} { + return map[string]interface{}{ + "blockHash": blockHash, + "blockNumber": hexutil.Uint64(blockNumber), + "transactionHash": blockHash, + "transactionIndex": hexutil.Uint64(receiptIndex), + "from": common.Address{}, + "to": nil, + "gasUsed": hexutil.Uint64(0), + "cumulativeGasUsed": hexutil.Uint64(0), + "contractAddress": nil, + "logs": logs, + "logsBloom": createBlockReceiptBloom(logs), + "type": hexutil.Uint(0), + "status": hexutil.Uint(types.ReceiptStatusSuccessful), + } + } + + tests := []struct { + name string + height uint64 + blockHash common.Hash + // DB data + headerBytes []byte + bodyBytes []byte + receiptsBytes []byte + // Expected parameters + blockReceiptIndex int + systemLogs []*types.Log + expectedValue map[string]interface{} + }{ + { + // Alfajores block 10 + name: "should return empty receipt when system logs are not included", + height: 10, + blockHash: common.HexToHash("0x88357030fa9168bbe0c8562c82cfe223e0153577d2794ddbff4efde2275b0498"), + headerBytes: common.FromHex("0xf90247a09589daad59e8c81b4a2a281cf5a5169c6ff216400f217ddad4c55e954d547dc594050f34537f5b2a00b9b9c752cb8500a3fce3da7da062108f4d26e60316648752793eb42a3eaebb915d95cddd19b0f55b7578df8e33a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a80845f10935ab8a2d983010001846765746889676f312e31332e3132856c696e7578000000000000f880c0c080b8411e4bd54dc4af4a9facd78505cda741e1408fa3a4644c4f15507cd98971e45e161b3017cda7335e99af540909527f40112a76f8839408a599abd4a829da6fc6ac01c3808080f58203bfb05d179831c524289815c583e26bbe5078e53f76730f2988c26939ad43323bead0c2c5227f901d7c475d7c69d8f0613e0080"), + bodyBytes: common.FromHex("0xc2c0c0"), + receiptsBytes: common.FromHex("0xc0"), + blockReceiptIndex: 0, + systemLogs: []*types.Log{}, + }, + { + // Alfajores block 10000 + name: "should return a receipt with system logs at the first index when the block has no transactions", + height: 10000, + blockHash: common.HexToHash("0x103a73e9f82d8262a0d9aac30d40d076ca04fd1e386fbf68ce55077d53044620"), + headerBytes: common.FromHex("0xf90249a0c9b55fbdda2b4576a0af2b7d12b3655acd16b8387eb9c8cfba9495f29209ce8894456f41406b32c45d59e539e4bba3d7898c3584daa02bca916f2b161bf620680cbfd51a54d67c4a6fb9deb7df9ca8e13b0de5ed06e5a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0cdf4c02f7858a71c21f8b898f61ad4bad088eb504c6ebf992acccb3369f26967b901000000000000020000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000082271080845f115779b8a2d983010001846765746889676f312e31332e3132856c696e7578000000000000f880c0c080b84105c3d441c1e2e58ca94ed3181639e0cb227605ecd9fdb52b339b52a967f5253d0f68157ccf71dc2a27dc876e75f054bd21bd0620db782903b5ff5c68a54e0a6700c3808080f58203ffb0a895e801ce216fdaa066bb8fedd9a41719f2d48b661c1262f65e0ba1cd4eacb812a3865d4b510d7ff42a5b921ad0178080"), + bodyBytes: common.FromHex("0xc2c0c0"), + receiptsBytes: common.FromHex("0xf90164f901610180b9010000000000000200000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f85af85894d0bf87a5936ee17014a057143a494dc5c5d51e5ee1a06e53b2f8b69496c2a175588ad1326dbabe2f66df4d82f817aeca52e3474807fba00000000000000000000000000000000000000000000000000000000005f5e100"), + blockReceiptIndex: 0, + systemLogs: []*types.Log{ + { + BlockNumber: 10000, + TxHash: common.HexToHash("0x103a73e9f82d8262a0d9aac30d40d076ca04fd1e386fbf68ce55077d53044620"), + BlockHash: common.HexToHash("0x103a73e9f82d8262a0d9aac30d40d076ca04fd1e386fbf68ce55077d53044620"), + TxIndex: 0, + Address: common.HexToAddress("0xd0Bf87a5936ee17014a057143a494Dc5C5d51E5e"), // GasPriceMinimumProxy + Topics: []common.Hash{ + common.Hash(crypto.Keccak256([]byte("GasPriceMinimumUpdated(uint256)"))), + }, + Data: common.FromHex("0x0000000000000000000000000000000000000000000000000000000005f5e100"), // 0.1 GWei + }, + }, + }, + { + // Alfajores block 10000000 + name: "should return a receipt with system logs at the last index when the block has transactions", + height: 10000000, + blockHash: common.HexToHash("0xea3090f7c584b577ac095a7ecf791e6a2c62cce3fda3049d84859f97fd33b237"), + headerBytes: common.FromHex("0xf9024da0cb347611c69a27905f4ce41a0788ba4c4c9267f2c7c67c07cd58c941cc5d748f94a62cf252409104f7f0efb516c074590ea9873814a06d0383ea1377ee138014baab5f488efe5e7d043820fbb59818e42361a9c78f50a0adb394f71cac2d374088df8be850195b710313d95a666505c34deb5c4e22c4aca0c1a5e03975c3db3409678e8a5740374e8c2a3118f7f7d4dafbb025d5daf3cb37b90100008001000002000400000000000080080000000000000000000008000000010000000000000000000000000000002088024000000800000020028002001000020000000000000000000000080001000000000000040000000000a000000000020000000000040000000000000000800000000000000000000000001040000000000000418000004040000010200000000000000000000000000000000000100000000084000040404000000000000020000000000000800400000004000000000000000600000000000100080100400100000000000000000001000000000000080000000000000010000000000000002441002000000000800100000000000083989680830b601984621229fcb8a2d983010503846765746889676f312e31362e3134856c696e7578000000000000f880c0c080b841010b072ab976db2fdeedd807966bf8781a37601296c11d863e9bc0a8c2d28793587cbc926fe71c31cd453e64af4dcdbe0d79668afc41959d11a434b903f3b79101c3808080f58203ffb0d1b2e8d48fc066de441f23ea851fe56fed8d8b27df83c5142a91e01e488e8c928c442e3ebae00241e2f930356d5bd30080"), + bodyBytes: common.FromHex("0xf9034cf90348f8f283023f7e8423c346008304340580808094fdd8bd58115ffbf04e47411c1d228ecc45e9307580b88480e50744000000000000000000000000874069fa1eb16d44d622f2e0ca25eea172369bc1000000000000000000000000000000000000000000022147f867fa562023bfe0000000000000000000000000fc0ea86dbdfe9cb432bafde251bd2deba022afd7000000000000000000000000473a3be7c2a42452ed0b521614b3b76bc59d2d1d83015e0aa01acccf39f557113d5a9f709e28d673b8a323219351ea98a50b9d23bc509a946aa02859b4eb0daa5fdd9010036e42d000403899aff1a9e004226ef1bb7dcec57954f8f18287f38423c34600830488fe80808094fdd8bd58115ffbf04e47411c1d228ecc45e9307580b88480e50744000000000000000000000000e4d517785d091d3c54818832db6094bcc27445450000000000000000000000000000000000000000000b137cc419114e208700300000000000000000000000009031de3e5373992410ee819a689178125b51db2400000000000000000000000026833fb268767f3e4a05d5a1a2ea9fe2590f9d5883015e0aa050ed505bc913c8a5c670a33e061868a0f1e914f0ac1cfd2ad19986b7296a8235a00bfe2247018e7a72784dabc50df1f3218b8506fd6de731ea04d4077bc1742575f8f2830235c58423c346008304890d80808094fdd8bd58115ffbf04e47411c1d228ecc45e9307580b88480e5074400000000000000000000000010c892a6ec43a53e45d0b916b4b7d383b1b78c0f00000000000000000000000000000000000000000001e2092887279c5176bea000000000000000000000000072710d8a8bdc7a2476cde04050849d29e873591c000000000000000000000000658d897ed714a250ebf979de19788dfb065b52eb83015e09a0b91ae8b811f1ac86d51450b3f7e0047cc1c2e99da507e2daa3359518264d926fa0353a21b67608d6b4d709292e5150bc9f9783a95421157e250f843dea5241a71ff86b59841dcd6500830251c59404c3d955e84fbcbe159d8eeceaf77d16b52a47e080843ccfd60b83015e0aa04228c520d62e63bbd670f242509afcd65376ed7551d7ee10cfb6432e87d170f6a00bf23ec50d4f60b2a15b02637dac6e512a8c7680a5ee82cf004348f3caf6afb6c0"), + receiptsBytes: common.FromHex("0xf9109af90245018302e9c0b9010000800000000000000000000000000000000000000000000000000800000001000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000100000000000004000000000000000000000200000000000000000000000000008000000000000000000000000000000000000000000000000040400000000000000000000000000000000000000000000000000000800000004000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000f9013af8bc94fdd8bd58115ffbf04e47411c1d228ecc45e93075f863a07cebb17173a9ed273d2b7538f64395c0ebf352ff743f1cf8ce66b437a6144213a0000000000000000000000000874069fa1eb16d44d622f2e0ca25eea172369bc1a00000000000000000000000003e4dbf92e5f19be41e1faa6368779418a610191fb84000000000000000000000000000000000000000000000000000000000621229fc000000000000000000000000000000000000000000022147f867fa562023bfe0f87a94fdd8bd58115ffbf04e47411c1d228ecc45e93075f842a0a9981ebfc3b766a742486e898f54959b050a66006dbce1a4155c1f84a08bcf41a0000000000000000000000000874069fa1eb16d44d622f2e0ca25eea172369bc1a0000000000000000000000000000000000000000000022147f867fa562023bfe0f90245018305fc04b9010000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008800000000000000000000000200000000000000000000000000000000000100000000000004000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000004000000000400000100000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000010000000000000000000000000000000000000000000004000000000000000000000000000000f9013af8bc94fdd8bd58115ffbf04e47411c1d228ecc45e93075f863a07cebb17173a9ed273d2b7538f64395c0ebf352ff743f1cf8ce66b437a6144213a0000000000000000000000000e4d517785d091d3c54818832db6094bcc2744545a000000000000000000000000001cf98f45d2f0d332b97e1e9b7cf93fb4334324cb84000000000000000000000000000000000000000000000000000000000621229fc0000000000000000000000000000000000000000000b137cc419114e20870030f87a94fdd8bd58115ffbf04e47411c1d228ecc45e93075f842a0a9981ebfc3b766a742486e898f54959b050a66006dbce1a4155c1f84a08bcf41a0000000000000000000000000e4d517785d091d3c54818832db6094bcc2744545a00000000000000000000000000000000000000000000b1250dc573ead179fce10f902450183090e54b9010000800000000000040000000000000008000000000000000000000000000000000000000000000000000000000000000802000000000000000000000000000000000000000000000000000000000100000000000004000000000080000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000840000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000f9013af8bc94fdd8bd58115ffbf04e47411c1d228ecc45e93075f863a07cebb17173a9ed273d2b7538f64395c0ebf352ff743f1cf8ce66b437a6144213a000000000000000000000000010c892a6ec43a53e45d0b916b4b7d383b1b78c0fa0000000000000000000000000372a0400d646cf5e5e7fed74755ec87ba9d4b135b84000000000000000000000000000000000000000000000000000000000621229fc00000000000000000000000000000000000000000001e2092887279c5176bea0f87a94fdd8bd58115ffbf04e47411c1d228ecc45e93075f842a0a9981ebfc3b766a742486e898f54959b050a66006dbce1a4155c1f84a08bcf41a000000000000000000000000010c892a6ec43a53e45d0b916b4b7d383b1b78c0fa000000000000000000000000000000000000000000001e1da69651598fb3beb70f9085b01830b6019b9010000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000400000080000002002800000100002000000000000000000000008000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000010400000000000000100000000000000002000000000000000000000000000000000001000000000000000400040000000000000000000000000008004000000000000000000000002000000000001000000004001000000000000000000010000000000000800000000000000100000000000000020410020000000008001000000000000f90750f89b9480bf978a507de013523472993266744a815ff109f863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa000000000000000000000000004c3d955e84fbcbe159d8eeceaf77d16b52a47e0a000000000000000000000000041a5b742563916ea538053f8a2448ec7b2f51c4ea000000000000000000000000000000000000000000000003635c9adc5dea00000f8999404c3d955e84fbcbe159d8eeceaf77d16b52a47e0e1a09b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8ebb86000000000000000000000000041a5b742563916ea538053f8a2448ec7b2f51c4e00000000000000000000000080bf978a507de013523472993266744a815ff10900000000000000000000000000000000000000000000003635c9adc5dea00000f89b94c6c31fc6f19b924c8e4feb92c1e6b07758c06cfcf863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa000000000000000000000000004c3d955e84fbcbe159d8eeceaf77d16b52a47e0a000000000000000000000000041a5b742563916ea538053f8a2448ec7b2f51c4ea000000000000000000000000000000000000000000000003635c9adc5dea00000f8999404c3d955e84fbcbe159d8eeceaf77d16b52a47e0e1a09b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8ebb86000000000000000000000000041a5b742563916ea538053f8a2448ec7b2f51c4e000000000000000000000000c6c31fc6f19b924c8e4feb92c1e6b07758c06cfc00000000000000000000000000000000000000000000003635c9adc5dea00000f89b947d91e51c8f218f7140188a155f5c75388630b6a8f863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa000000000000000000000000004c3d955e84fbcbe159d8eeceaf77d16b52a47e0a000000000000000000000000041a5b742563916ea538053f8a2448ec7b2f51c4ea000000000000000000000000000000000000000000000003635c9adc5dea00000f8999404c3d955e84fbcbe159d8eeceaf77d16b52a47e0e1a09b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8ebb86000000000000000000000000041a5b742563916ea538053f8a2448ec7b2f51c4e0000000000000000000000007d91e51c8f218f7140188a155f5c75388630b6a800000000000000000000000000000000000000000000003635c9adc5dea00000f89b94dbc8aadf7b38479668136d84a2193a442186b793f863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa000000000000000000000000004c3d955e84fbcbe159d8eeceaf77d16b52a47e0a000000000000000000000000041a5b742563916ea538053f8a2448ec7b2f51c4ea00000000000000000000000000000000000000000000000056bc75e2d63100000f8999404c3d955e84fbcbe159d8eeceaf77d16b52a47e0e1a09b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8ebb86000000000000000000000000041a5b742563916ea538053f8a2448ec7b2f51c4e000000000000000000000000dbc8aadf7b38479668136d84a2193a442186b7930000000000000000000000000000000000000000000000056bc75e2d63100000f89b94fb845cc3bc4041d3e0570c0b9ad65ffdd1c8f84ef863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa000000000000000000000000004c3d955e84fbcbe159d8eeceaf77d16b52a47e0a000000000000000000000000041a5b742563916ea538053f8a2448ec7b2f51c4ea00000000000000000000000000000000000000000000000056bc75e2d63100000f8999404c3d955e84fbcbe159d8eeceaf77d16b52a47e0e1a09b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8ebb86000000000000000000000000041a5b742563916ea538053f8a2448ec7b2f51c4e000000000000000000000000fb845cc3bc4041d3e0570c0b9ad65ffdd1c8f84e0000000000000000000000000000000000000000000000056bc75e2d63100000f89b94c5375c73a627105eb4df00867717f6e301966c32f863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa000000000000000000000000004c3d955e84fbcbe159d8eeceaf77d16b52a47e0a000000000000000000000000041a5b742563916ea538053f8a2448ec7b2f51c4ea000000000000000000000000000000000000000000000003635c9adc5dea00000f8999404c3d955e84fbcbe159d8eeceaf77d16b52a47e0e1a09b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8ebb86000000000000000000000000041a5b742563916ea538053f8a2448ec7b2f51c4e000000000000000000000000c5375c73a627105eb4df00867717f6e301966c3200000000000000000000000000000000000000000000003635c9adc5dea00000f901610180b9010000000000000200000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f85af85894d0bf87a5936ee17014a057143a494dc5c5d51e5ee1a06e53b2f8b69496c2a175588ad1326dbabe2f66df4d82f817aeca52e3474807fba00000000000000000000000000000000000000000000000000000000005f5e100"), + blockReceiptIndex: 4, + systemLogs: []*types.Log{ + { + BlockNumber: 10000000, + TxHash: common.HexToHash("0xea3090f7c584b577ac095a7ecf791e6a2c62cce3fda3049d84859f97fd33b237"), + BlockHash: common.HexToHash("0xea3090f7c584b577ac095a7ecf791e6a2c62cce3fda3049d84859f97fd33b237"), + TxIndex: 4, + Index: 18, + Address: common.HexToAddress("0xd0Bf87a5936ee17014a057143a494Dc5C5d51E5e"), // GasPriceMinimumProxy + Topics: []common.Hash{ + common.Hash(crypto.Keccak256([]byte("GasPriceMinimumUpdated(uint256)"))), + }, + Data: common.FromHex("0x0000000000000000000000000000000000000000000000000000000005f5e100"), // 0.1 GWei + }, + }, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + seedData(t, test.blockHash, test.height, test.headerBytes, test.bodyBytes, test.receiptsBytes) + + expectedValue := createExpectedResponse(test.blockHash, test.height, test.blockReceiptIndex, test.systemLogs) + + res, err := api.GetBlockReceipt(context.Background(), test.blockHash) + require.NoError(t, err) + assert.Equal(t, expectedValue, res) + }) + } +}