From 5acecec95582554972f93e09c30fe9306c468421 Mon Sep 17 00:00:00 2001 From: Arijit Das Date: Thu, 16 Sep 2021 19:15:56 +0530 Subject: [PATCH] Fix failing test. --- docker-compose.yml | 2 +- go.mod | 2 +- go.sum | 4 ++-- pkg/eth/cid_retriever.go | 2 +- pkg/eth/cid_retriever_test.go | 4 ++-- pkg/eth/filterer_test.go | 4 ++-- pkg/eth/test_helpers/test_data.go | 10 +++++----- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 0eaeec95..f6e190b2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,7 @@ services: restart: unless-stopped depends_on: - statediff-migrations - image: vulcanize/dapptools:latest + image: vulcanize/dapptools:v0.29.0-v1.10.8-statediff-0.0.26 environment: DB_USER: vdbm DB_NAME: vulcanize_public diff --git a/go.mod b/go.mod index 57cca33e..98c0a52b 100644 --- a/go.mod +++ b/go.mod @@ -29,4 +29,4 @@ require ( github.com/vulcanize/ipfs-ethdb v0.0.4 ) -replace github.com/ethereum/go-ethereum v1.10.8 => github.com/vulcanize/go-ethereum v1.10.8-statediff-0.0.26 +replace github.com/ethereum/go-ethereum v1.10.8 => github.com/vulcanize/go-ethereum v1.10.8-statediff-0.0.26.0.20210916121617-b1f2fcf diff --git a/go.sum b/go.sum index e07721e5..8c8520a4 100644 --- a/go.sum +++ b/go.sum @@ -1315,8 +1315,8 @@ github.com/vulcanize/eth-ipfs-state-validator v0.0.1 h1:CsKerIVD7Dq1SvWK93b3LOVY github.com/vulcanize/eth-ipfs-state-validator v0.0.1/go.mod h1:NxzWqnHkHG4a1gsQJ0MJgkDU2vmy5w4iGOX693HMbIU= github.com/vulcanize/gap-filler v0.3.1 h1:N5d+jCJo/VTWFvBSbTD7biRhK/OqDZzi1tgA85SIBKs= github.com/vulcanize/gap-filler v0.3.1/go.mod h1:qowG1cgshVpBqMokiWro/1xhh0uypw7oAu8FQ42JMy4= -github.com/vulcanize/go-ethereum v1.10.8-statediff-0.0.26 h1:1UBVQpeJnHkmSKxXanbNGE8w+LR0iZhfGr0QrQ62+C4= -github.com/vulcanize/go-ethereum v1.10.8-statediff-0.0.26/go.mod h1:nXs5fPBjAVzBmIGtrc0f7akQwkXI5Mi+6I1QcbD2br0= +github.com/vulcanize/go-ethereum v1.10.8-statediff-0.0.26.0.20210916121617-38a9e267e1f9 h1:j5ggS3vQt/EJIG1WSC4z1re4RnhGvEuswKU1hxcza1w= +github.com/vulcanize/go-ethereum v1.10.8-statediff-0.0.26.0.20210916121617-38a9e267e1f9/go.mod h1:nXs5fPBjAVzBmIGtrc0f7akQwkXI5Mi+6I1QcbD2br0= github.com/vulcanize/ipfs-ethdb v0.0.3/go.mod h1:VHyO1HhUYRtxsQ0EpF06VGGP8w4zGjvd+hXL6GK35xw= github.com/vulcanize/ipfs-ethdb v0.0.4 h1:rAnkju1NUSBFZgRVUZQOXebA9Kkyq4L8sCzJfeXPjPY= github.com/vulcanize/ipfs-ethdb v0.0.4/go.mod h1:IueWysMbZu0uFmu+ia6mEnyWsTvwe2q2lbYdy2muRUM= diff --git a/pkg/eth/cid_retriever.go b/pkg/eth/cid_retriever.go index c0167a39..82c75df6 100644 --- a/pkg/eth/cid_retriever.go +++ b/pkg/eth/cid_retriever.go @@ -316,7 +316,7 @@ func (ecr *CIDRetriever) RetrieveFilteredGQLLogs(tx *sqlx.Tx, rctFilter ReceiptF id := 1 pgStr := `SELECT eth.log_cids.leaf_cid, eth.log_cids.index, eth.log_cids.receipt_id, eth.log_cids.address, eth.log_cids.topic0, eth.log_cids.topic1, eth.log_cids.topic2, eth.log_cids.topic3, - eth.log_cids.log_data, eth.transaction_cids.tx_hash, data, eth.receipt_cids.leaf_cid, eth.receipt_cids.post_status + eth.log_cids.log_data, eth.transaction_cids.tx_hash, data, eth.receipt_cids.leaf_cid as cid, eth.receipt_cids.post_status FROM eth.log_cids, eth.receipt_cids, eth.transaction_cids, eth.header_cids, public.blocks WHERE eth.log_cids.receipt_id = receipt_cids.id AND receipt_cids.tx_id = transaction_cids.id diff --git a/pkg/eth/cid_retriever_test.go b/pkg/eth/cid_retriever_test.go index c575e3cc..248ab071 100644 --- a/pkg/eth/cid_retriever_test.go +++ b/pkg/eth/cid_retriever_test.go @@ -264,7 +264,7 @@ var _ = Describe("Retriever", func() { Expect(eth.TxModelsContainsCID(cids[0].Transactions, test_helpers.MockCIDWrapper.Transactions[0].CID)).To(BeTrue()) Expect(eth.TxModelsContainsCID(cids[0].Transactions, test_helpers.MockCIDWrapper.Transactions[1].CID)).To(BeTrue()) Expect(eth.TxModelsContainsCID(cids[0].Transactions, test_helpers.MockCIDWrapper.Transactions[2].CID)).To(BeTrue()) - Expect(len(cids[0].Receipts)).To(Equal(3)) + Expect(len(cids[0].Receipts)).To(Equal(4)) Expect(eth.ReceiptModelsContainsCID(cids[0].Receipts, expectedRctCIDsAndLeafNodes[0].LeafCID)).To(BeTrue()) Expect(eth.ReceiptModelsContainsCID(cids[0].Receipts, expectedRctCIDsAndLeafNodes[1].LeafCID)).To(BeTrue()) Expect(eth.ReceiptModelsContainsCID(cids[0].Receipts, expectedRctCIDsAndLeafNodes[2].LeafCID)).To(BeTrue()) @@ -381,7 +381,7 @@ var _ = Describe("Retriever", func() { Expect(eth.TxModelsContainsCID(cids5[0].Transactions, test_helpers.Trx3CID.String())).To(BeTrue()) Expect(len(cids5[0].StateNodes)).To(Equal(0)) Expect(len(cids5[0].StorageNodes)).To(Equal(0)) - Expect(len(cids5[0].Receipts)).To(Equal(3)) + Expect(len(cids5[0].Receipts)).To(Equal(4)) Expect(eth.ReceiptModelsContainsCID(cids5[0].Receipts, expectedRctCIDsAndLeafNodes[0].LeafCID)).To(BeTrue()) Expect(eth.ReceiptModelsContainsCID(cids5[0].Receipts, expectedRctCIDsAndLeafNodes[1].LeafCID)).To(BeTrue()) Expect(eth.ReceiptModelsContainsCID(cids5[0].Receipts, expectedRctCIDsAndLeafNodes[2].LeafCID)).To(BeTrue()) diff --git a/pkg/eth/filterer_test.go b/pkg/eth/filterer_test.go index eb09dd5e..84f4de44 100644 --- a/pkg/eth/filterer_test.go +++ b/pkg/eth/filterer_test.go @@ -52,7 +52,7 @@ var _ = Describe("Filterer", func() { Expect(shared.IPLDsContainBytes(iplds.Transactions, test_helpers.Tx1)).To(BeTrue()) Expect(shared.IPLDsContainBytes(iplds.Transactions, test_helpers.Tx2)).To(BeTrue()) Expect(shared.IPLDsContainBytes(iplds.Transactions, test_helpers.Tx3)).To(BeTrue()) - Expect(len(iplds.Receipts)).To(Equal(3)) + Expect(len(iplds.Receipts)).To(Equal(4)) Expect(shared.IPLDsContainBytes(iplds.Receipts, test_helpers.Rct1IPLD)).To(BeTrue()) Expect(shared.IPLDsContainBytes(iplds.Receipts, test_helpers.Rct2IPLD)).To(BeTrue()) Expect(shared.IPLDsContainBytes(iplds.Receipts, test_helpers.Rct3IPLD)).To(BeTrue()) @@ -148,7 +148,7 @@ var _ = Describe("Filterer", func() { Expect(shared.IPLDsContainBytes(iplds5.Transactions, test_helpers.Tx3)).To(BeTrue()) Expect(len(iplds5.StorageNodes)).To(Equal(0)) Expect(len(iplds5.StateNodes)).To(Equal(0)) - Expect(len(iplds5.Receipts)).To(Equal(3)) + Expect(len(iplds5.Receipts)).To(Equal(4)) Expect(shared.IPLDsContainBytes(iplds5.Receipts, test_helpers.Rct1IPLD)).To(BeTrue()) Expect(shared.IPLDsContainBytes(iplds5.Receipts, test_helpers.Rct2IPLD)).To(BeTrue()) Expect(shared.IPLDsContainBytes(iplds5.Receipts, test_helpers.Rct3IPLD)).To(BeTrue()) diff --git a/pkg/eth/test_helpers/test_data.go b/pkg/eth/test_helpers/test_data.go index 5d7bd84e..d67f607d 100644 --- a/pkg/eth/test_helpers/test_data.go +++ b/pkg/eth/test_helpers/test_data.go @@ -177,7 +177,7 @@ var ( Trx3CID, _ = ipld.RawdataToCid(ipld.MEthTx, Tx3, multihash.KECCAK_256) Trx3MhKey = shared.MultihashKeyFromCID(Trx3CID) Trx4CID, _ = ipld.RawdataToCid(ipld.MEthTx, Tx4, multihash.KECCAK_256) - Trx4MhKey = shared.MultihashKeyFromCID(Trx3CID) + Trx4MhKey = shared.MultihashKeyFromCID(Trx4CID) Rct1CID = rctCIDs[0] Rct1MhKey = shared.MultihashKeyFromCID(Rct1CID) Rct2CID = rctCIDs[1] @@ -266,10 +266,10 @@ var ( CID: Trx4CID.String(), MhKey: Trx4MhKey, Src: SenderAddr.Hex(), - Dst: "", - Index: 2, - TxHash: MockTransactions[2].Hash().String(), - Data: MockContractByteCode, + Dst: AnotherAddress1.String(), + Index: 3, + TxHash: MockTransactions[3].Hash().String(), + Data: []byte{}, }, } MockRctMeta = []models.ReceiptModel{