Add test for GetStorageAt RPC.

This commit is contained in:
Arijit Das
2021-06-10 11:51:38 +05:30
parent 9cf75ca66c
commit 2c1bc557e5
3 changed files with 40 additions and 7 deletions
+11
View File
@@ -380,6 +380,17 @@ var _ = Describe("Integration test", func() {
Expect(err).ToNot(HaveOccurred())
Expect(gethStorage).To(Equal(ipldStorage))
})
It("gets storage for non-existing block number", func() {
blockNum := contract.BlockNumber + 100
totalSupplyIndex := "0x2"
gethStorage, err := gethClient.StorageAt(ctx, common.HexToAddress(contract.Address), common.HexToHash(totalSupplyIndex), big.NewInt(int64(blockNum)))
Expect(err).To(MatchError("header not found"))
ipldStorage, err := ipldClient.StorageAt(ctx, common.HexToAddress(contract.Address), common.HexToHash(totalSupplyIndex), big.NewInt(int64(blockNum)))
Expect(err).To(MatchError("header not found"))
Expect(gethStorage).To(Equal(ipldStorage))
})
})
Describe("eth call", func() {