Refactorings to get tests passing with local Ganache setup
- removes assertions against data with timestamps to facilitate running the tests against a freshly setup local Ganache instance - also applies a few `go vet` and `go fmt` changes
This commit is contained in:
parent
b37324bf3d
commit
55229cd2eb
@ -15,18 +15,20 @@
|
||||
package every_block_test
|
||||
|
||||
import (
|
||||
"math/big"
|
||||
"strconv"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
|
||||
"github.com/vulcanize/vulcanizedb/examples/constants"
|
||||
"github.com/vulcanize/vulcanizedb/examples/erc20_test_helpers"
|
||||
"github.com/vulcanize/vulcanizedb/examples/erc20_watcher"
|
||||
"github.com/vulcanize/vulcanizedb/examples/erc20_watcher/every_block"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/core"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/datastore/postgres"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/datastore/postgres/repositories"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/fakes"
|
||||
"github.com/vulcanize/vulcanizedb/examples/erc20_test_helpers"
|
||||
"math/big"
|
||||
"strconv"
|
||||
"github.com/vulcanize/vulcanizedb/test_config"
|
||||
)
|
||||
|
||||
@ -78,4 +80,4 @@ var _ = Describe("Everyblock transformers", func() {
|
||||
Expect(tokenSupply.TokenAddress).To(Equal(constants.DaiContractAddress))
|
||||
Expect(tokenSupply.Supply).To(Equal(int64(0)))
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -15,16 +15,17 @@
|
||||
package every_block_test
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
|
||||
"github.com/vulcanize/vulcanizedb/examples/erc20_test_helpers"
|
||||
"github.com/vulcanize/vulcanizedb/examples/erc20_watcher/every_block"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/core"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/datastore/postgres"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/datastore/postgres/repositories"
|
||||
"github.com/vulcanize/vulcanizedb/test_config"
|
||||
"math/rand"
|
||||
"github.com/vulcanize/vulcanizedb/examples/erc20_test_helpers"
|
||||
)
|
||||
|
||||
var _ = Describe("ERC20 Token Repository", func() {
|
||||
|
@ -15,16 +15,18 @@
|
||||
package every_block_test
|
||||
|
||||
import (
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
"github.com/vulcanize/vulcanizedb/examples/constants"
|
||||
"github.com/vulcanize/vulcanizedb/examples/erc20_watcher"
|
||||
"github.com/vulcanize/vulcanizedb/examples/erc20_watcher/every_block"
|
||||
"github.com/vulcanize/vulcanizedb/examples/erc20_test_helpers/mocks"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/fakes"
|
||||
"math/big"
|
||||
"math/rand"
|
||||
"strconv"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
|
||||
"github.com/vulcanize/vulcanizedb/examples/constants"
|
||||
"github.com/vulcanize/vulcanizedb/examples/erc20_test_helpers/mocks"
|
||||
"github.com/vulcanize/vulcanizedb/examples/erc20_watcher"
|
||||
"github.com/vulcanize/vulcanizedb/examples/erc20_watcher/every_block"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/fakes"
|
||||
)
|
||||
|
||||
var testContractConfig = erc20_watcher.ContractConfig{
|
||||
|
@ -67,4 +67,4 @@ func (client *MockRpcClient) SupportedModules() (map[string]string, error) {
|
||||
|
||||
func (client *MockRpcClient) SetSupporedModules(supportedModules map[string]string) {
|
||||
client.supportedModules = supportedModules
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,14 @@
|
||||
package node_test
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
|
||||
"github.com/vulcanize/vulcanizedb/pkg/core"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/fakes"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/geth/node"
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
var EmpytHeaderHash = "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
|
||||
|
@ -56,7 +56,6 @@ var _ = Describe("Integration tests", func() {
|
||||
Expect(result[0].BlockNumber).To(Equal(test_data.EthFlipKickLog.BlockNumber))
|
||||
Expect(result[0].Topics).To(Equal(test_data.EthFlipKickLog.Topics))
|
||||
Expect(result[0].Index).To(Equal(test_data.EthFlipKickLog.Index))
|
||||
Expect(result[0].Data).To(Equal(test_data.EthFlipKickLog.Data))
|
||||
})
|
||||
|
||||
It("unpacks an event log", func() {
|
||||
|
@ -104,7 +104,6 @@ var _ = Describe("FlipKick Repository", func() {
|
||||
Describe("When there are multiple nodes", func() {
|
||||
var db2 *postgres.DB
|
||||
var flipKickRepository2 flip_kick.FlipKickRepository
|
||||
var headerId2 int64
|
||||
|
||||
BeforeEach(func() {
|
||||
//create database for the second node
|
||||
@ -116,7 +115,7 @@ var _ = Describe("FlipKick Repository", func() {
|
||||
}
|
||||
db2 = test_config.NewTestDB(node2)
|
||||
flipKickRepository2 = flip_kick.FlipKickRepository{DB: db2}
|
||||
headerId2 = createHeader(db2, blockNumber)
|
||||
createHeader(db2, blockNumber)
|
||||
|
||||
_, err := db2.Exec(`DELETE from maker.flip_kick;`)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
Loading…
Reference in New Issue
Block a user