integration test #53

Merged
ramilexe merged 32 commits from integration_tests into endpoints 2021-06-18 06:59:19 +00:00
ramilexe commented 2021-04-16 13:57:46 +00:00 (Migrated from github.com)
No description provided.
ashwinphatak (Migrated from github.com) reviewed 2021-06-04 04:22:20 +00:00
@ -645,3 +695,3 @@
storageVal, err := pea.B.GetStorageByNumberOrHash(ctx, address, common.HexToHash(key), blockNrOrHash)
if storageVal != nil && err == nil {
return storageVal, nil
var value common.Hash
ashwinphatak (Migrated from github.com) commented 2021-06-04 04:16:56 +00:00

Did you confirm this behaviour against the standard JSON RPC API endpoint, i.e. expected result when the storage slot doesn't exist.

Did you confirm this behaviour against the standard JSON RPC API endpoint, i.e. expected result when the storage slot doesn't exist.
ashwinphatak (Migrated from github.com) commented 2021-06-04 04:18:13 +00:00

Add a comment explaining this value?

Add a comment explaining this value?
ashwinphatak (Migrated from github.com) commented 2021-06-04 04:19:56 +00:00

How are we confirming expected behaviour (same question for all new assertions)?

How are we confirming expected behaviour (same question for all new assertions)?
i-norden reviewed 2021-06-04 05:01:50 +00:00
@ -645,3 +695,3 @@
storageVal, err := pea.B.GetStorageByNumberOrHash(ctx, address, common.HexToHash(key), blockNrOrHash)
if storageVal != nil && err == nil {
return storageVal, nil
var value common.Hash
Member

Yeah I think this is undoing one of the fixes Ramil made here, the unit test is broken in what it is expecting rather than what it is receiving in this case (and probably all the cases where the unit tests were broken by the changes made in this PR, as the unit tests were passing before them). The majority of the problems this PR is fixing are due to me not anticipating (and failing to test) what the correct expected results were for error and nil cases. Ramil's integration tests compare the results to the results from a standard ETH JSON-RPC client so those are the source of truth.

Yeah I think this is undoing one of the fixes Ramil made here, the unit test is broken in what it is expecting rather than what it is receiving in this case (and probably all the cases where the unit tests were broken by the changes made in this PR, as the unit tests were passing before them). The majority of the problems this PR is fixing are due to me not anticipating (and failing to test) what the correct expected results were for error and nil cases. Ramil's integration tests compare the results to the results from a standard ETH JSON-RPC client so those are the source of truth.
arijitAD (Migrated from github.com) reviewed 2021-06-04 05:03:30 +00:00
@ -645,3 +695,3 @@
storageVal, err := pea.B.GetStorageByNumberOrHash(ctx, address, common.HexToHash(key), blockNrOrHash)
if storageVal != nil && err == nil {
return storageVal, nil
var value common.Hash
arijitAD (Migrated from github.com) commented 2021-06-04 05:03:30 +00:00

Yes, I confirmed the behavior manually.
We have two tests suite:
Unit test: Which makes calls to the DB and checks expectations.
Integration test: Which compares ETH and IPLD APIs response.
I will check if there is an Integration test for the same or else I will add it.

Yes, I confirmed the behavior manually. We have two tests suite: **Unit test:** Which makes calls to the DB and checks expectations. **Integration test**: Which compares ETH and IPLD APIs response. I will check if there is an Integration test for the same or else I will add it.
arijitAD (Migrated from github.com) reviewed 2021-06-04 05:04:36 +00:00
arijitAD (Migrated from github.com) commented 2021-06-04 05:04:36 +00:00
https://github.com/vulcanize/ipld-eth-server/pull/53#discussion_r645290501
arijitAD (Migrated from github.com) reviewed 2021-06-10 03:21:12 +00:00
arijitAD (Migrated from github.com) commented 2021-06-10 03:21:11 +00:00

Done

Done
ashwinphatak (Migrated from github.com) approved these changes 2021-06-11 05:24:12 +00:00
@ -22,3 +22,3 @@
- db
image: vulcanize/statediff-migrations:v0.3.0
image: vulcanize/statediff-migrations:v0.4.0
environment:
ashwinphatak (Migrated from github.com) commented 2021-06-11 05:15:15 +00:00

Check if this is the latest one?

Check if this is the latest one?
@ -0,0 +1,15 @@
Spin up services:
ashwinphatak (Migrated from github.com) commented 2021-06-11 05:22:34 +00:00

Add documentation on how to run the unit and integration tests.

Add documentation on how to run the unit and integration tests.
arijitAD (Migrated from github.com) reviewed 2021-06-14 04:57:40 +00:00
@ -0,0 +1,15 @@
Spin up services:
arijitAD (Migrated from github.com) commented 2021-06-14 04:57:40 +00:00

Done

Done
arijitAD (Migrated from github.com) reviewed 2021-06-14 04:58:10 +00:00
@ -22,3 +22,3 @@
- db
image: vulcanize/statediff-migrations:v0.3.0
image: vulcanize/statediff-migrations:v0.4.0
environment:
arijitAD (Migrated from github.com) commented 2021-06-14 04:58:10 +00:00

The test fails after upgrading the docker images.

The test fails after upgrading the docker images.
ashwinphatak (Migrated from github.com) reviewed 2021-06-14 05:02:04 +00:00
ashwinphatak (Migrated from github.com) commented 2021-06-14 05:02:04 +00:00

Typo ("intrgration")

Typo ("intrgration")
arijitAD (Migrated from github.com) reviewed 2021-06-14 05:25:46 +00:00
arijitAD (Migrated from github.com) commented 2021-06-14 05:25:46 +00:00

Done

Done
i-norden approved these changes 2021-06-14 20:16:47 +00:00
i-norden left a comment
Member

Looks great! Left a few nitpicky comments, otherwise this is good to merge.

Looks great! Left a few nitpicky comments, otherwise this is good to merge.
@ -22,3 +22,3 @@
- db
image: vulcanize/statediff-migrations:v0.3.0
image: vulcanize/statediff-migrations:v0.4.0
environment:
Member

Latest is v0.5.0

Latest is v0.5.0
Member

Should move this dep into the section below

Should move this dep into the section below
@ -244,23 +244,91 @@ func newRPCTransactionFromBlockIndex(b *types.Block, index uint64) *RPCTransacti
}
Member

This continue doesn't need the label

This continue doesn't need the label
@ -430,3 +430,2 @@
// RetrieveStorageAtByAddressAndStorageKeyAndBlockHash returns the cid and rlp bytes for the storage value corresponding to the provided address, storage key, and block hash
func (r *IPLDRetriever) RetrieveStorageAtByAddressAndStorageKeyAndBlockHash(address common.Address, storageLeafKey, hash common.Hash) (string, []byte, error) {
// RetrieveStorageAtByAddressAndStorageSlotAndBlockHash returns the cid and rlp bytes for the storage value corresponding to the provided address, storage slot, and block hash
Member

The name of this function implies the actual storage leaf key is provided to it, it shouldn't need to hash it again. If an actual storage key was provided this hashing would break the function. We should perform the hashing of the slot key into the leaf key at the level above or change the name to RetrieveStorageAtByAddressAndStorageSlotAndBlockHash so that the name aligns with the behavior.

The name of this function implies the actual storage leaf key is provided to it, it shouldn't need to hash it again. If an actual storage key was provided this hashing would break the function. We should perform the hashing of the slot key into the leaf key at the level above or change the name to `RetrieveStorageAtByAddressAndStorageSlotAndBlockHash` so that the name aligns with the behavior.
arijitAD (Migrated from github.com) reviewed 2021-06-18 06:43:30 +00:00
arijitAD (Migrated from github.com) commented 2021-06-18 06:43:29 +00:00

Done

Done
arijitAD (Migrated from github.com) reviewed 2021-06-18 06:43:35 +00:00
@ -244,23 +244,91 @@ func newRPCTransactionFromBlockIndex(b *types.Block, index uint64) *RPCTransacti
}
arijitAD (Migrated from github.com) commented 2021-06-18 06:43:35 +00:00

Done

Done
arijitAD (Migrated from github.com) reviewed 2021-06-18 06:44:00 +00:00
@ -430,3 +430,2 @@
// RetrieveStorageAtByAddressAndStorageKeyAndBlockHash returns the cid and rlp bytes for the storage value corresponding to the provided address, storage key, and block hash
func (r *IPLDRetriever) RetrieveStorageAtByAddressAndStorageKeyAndBlockHash(address common.Address, storageLeafKey, hash common.Hash) (string, []byte, error) {
// RetrieveStorageAtByAddressAndStorageSlotAndBlockHash returns the cid and rlp bytes for the storage value corresponding to the provided address, storage slot, and block hash
arijitAD (Migrated from github.com) commented 2021-06-18 06:43:59 +00:00

Updated it to RetrieveStorageAtByAddressAndStorageSlotAndBlockHash since the api gives us storage slot.

Updated it to `RetrieveStorageAtByAddressAndStorageSlotAndBlockHash` since the api gives us storage slot.
arijitAD commented 2021-06-18 06:55:36 +00:00 (Migrated from github.com)

The tests fail after updating the docker images. Created an issue for this https://github.com/vulcanize/ipld-eth-server/issues/73

The tests fail after updating the docker images. Created an issue for this https://github.com/vulcanize/ipld-eth-server/issues/73
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cerc-io/ipld-eth-server#53
No description provided.