Optimize GQL and getBlock APIs (#201)

* Add optional block number filter to getLogs API

* Use block number while fetching block with transactions

* Fix for failing tests

* Use block number when fetching block objects

* Use block number when fetching a tx by hash

* Add back methods to get block objects by block hash

* Update run_unit_test.sh

Removing echo command, as it seems to be only change in CICD.

* Increase wait time for db setup in unit test job

Co-authored-by: Michael <michael@abastionofsanity.com>
This commit is contained in:
prathamesh0
2022-11-04 10:02:09 +05:30
committed by GitHub
co-authored by Michael
parent 33602aa0e0
commit cc17368c0d
7 changed files with 208 additions and 35 deletions
+2 -2
View File
@@ -296,7 +296,7 @@ var _ = Describe("GraphQL", func() {
allEthHeaderCIDsResp, err := client.AllEthHeaderCIDs(ctx, graphql.EthHeaderCIDCondition{BlockHash: &blockHash})
Expect(err).ToNot(HaveOccurred())
headerCID, err := backend.Retriever.RetrieveHeaderAndTxCIDsByBlockHash(blocks[1].Hash())
headerCID, err := backend.Retriever.RetrieveHeaderAndTxCIDsByBlockHash(blocks[1].Hash(), nil)
Expect(err).ToNot(HaveOccurred())
Expect(len(allEthHeaderCIDsResp.Nodes)).To(Equal(1))
@@ -311,7 +311,7 @@ var _ = Describe("GraphQL", func() {
ethTransactionCIDResp, err := client.EthTransactionCIDByTxHash(ctx, txHash)
Expect(err).ToNot(HaveOccurred())
txCID, err := backend.Retriever.RetrieveTxCIDByHash(txHash)
txCID, err := backend.Retriever.RetrieveTxCIDByHash(txHash, nil)
Expect(err).ToNot(HaveOccurred())
compareEthTxCID(*ethTransactionCIDResp, txCID)