Add status field for pre-byzantium blocks.

This commit is contained in:
Arijit Das
2021-09-14 17:25:48 +05:30
parent 458aae1c1e
commit 04a0f9a751
14 changed files with 258 additions and 121 deletions
+21
View File
@@ -167,6 +167,11 @@ var _ = Describe("GraphQL", func() {
err = tx.Close(err)
Expect(err).ToNot(HaveOccurred())
tx, err = indexAndPublisher.PushBlock(test_helpers.MockByzantiumBlock, test_helpers.MockByzantiumReceipts, test_helpers.MockByzantiumBlock.Difficulty())
Expect(err).ToNot(HaveOccurred())
err = tx.Close(err)
Expect(err).ToNot(HaveOccurred())
graphQLServer, err = graphql.New(backend, gqlEndPoint, nil, []string{"*"}, rpc.HTTPTimeouts{})
Expect(err).ToNot(HaveOccurred())
@@ -216,6 +221,22 @@ var _ = Describe("GraphQL", func() {
Expect(logs).To(Equal(expectedLogs))
})
It("Retrieve logs for pre byzantium block", func() {
logs, err := client.GetLogs(ctx, test_helpers.MockByzantiumBlock.Hash(), nil)
Expect(err).ToNot(HaveOccurred())
expectedLogs := []graphql.LogResponse{
{
Topics: test_helpers.MockLog7.Topics,
Data: hexutil.Bytes(test_helpers.MockLog1.Data),
Transaction: graphql.TransactionResp{Hash: test_helpers.MockByzantiumTransactions[0].Hash()},
ReceiptCID: test_helpers.ByzantiumRctCID.String(),
Status: int32(test_helpers.MockByzantiumReceipts[0].Status),
},
}
Expect(logs).To(Equal(expectedLogs))
})
It("Retrieves all the logs for the receipt that matches the provided blockHash and nil contract address", func() {
logs, err := client.GetLogs(ctx, blockHash, nil)
Expect(err).ToNot(HaveOccurred())