Remove unused param in integration test helper

This commit is contained in:
Rob Mulholand 2018-10-24 21:26:54 -05:00
parent 8831586fba
commit 3ec5b4afab
21 changed files with 37 additions and 42 deletions

View File

@ -37,7 +37,7 @@ var _ = Describe("Bite Transformer", func() {
db := test_config.NewTestDB(blockchain.Node())
test_config.CleanTestDB(db)
err = persistHeader(rpcClient, db, blockNumber)
err = persistHeader(db, blockNumber)
Expect(err).NotTo(HaveOccurred())
initializer := bite.BiteTransformerInitializer{Config: config}

View File

@ -53,7 +53,7 @@ var _ = Describe("Cat File transformer", func() {
It("persists a chop lump event", func() {
// transaction: 0x98574bfba4d05c3875be10d2376e678d005dbebe9a4520363407508fd21f4014
chopLumpBlockNumber := int64(8762253)
err = persistHeader(rpcClient, db, chopLumpBlockNumber)
err = persistHeader(db, chopLumpBlockNumber)
Expect(err).NotTo(HaveOccurred())
config := cat_file.CatFileConfig
@ -86,7 +86,7 @@ var _ = Describe("Cat File transformer", func() {
It("persists a flip event", func() {
// transaction: 0x44bc18fdb1a5a263db114e7879653304db3e19ceb4e4496f21bc0a76c5faccbe
flipBlockNumber := int64(8751794)
err = persistHeader(rpcClient, db, flipBlockNumber)
err = persistHeader(db, flipBlockNumber)
Expect(err).NotTo(HaveOccurred())
config := cat_file.CatFileConfig
@ -111,7 +111,7 @@ var _ = Describe("Cat File transformer", func() {
It("persists a pit vow event", func() {
// transaction: 0x44bc18fdb1a5a263db114e7879653304db3e19ceb4e4496f21bc0a76c5faccbe
pitVowBlockNumber := int64(8751794)
err = persistHeader(rpcClient, db, pitVowBlockNumber)
err = persistHeader(db, pitVowBlockNumber)
Expect(err).NotTo(HaveOccurred())
config := cat_file.CatFileConfig

View File

@ -48,7 +48,7 @@ var _ = Describe("Deal transformer", func() {
It("persists a flip deal log event", func() {
// transaction: 0x05b5eabac2ace136f0f7e0efc61d7d42abe8e8938cc0f04fbf1a6ba545d59e58
flipBlockNumber := int64(8958007)
err = persistHeader(rpcClient, db, flipBlockNumber)
err = persistHeader(db, flipBlockNumber)
Expect(err).NotTo(HaveOccurred())
config := deal.Config

View File

@ -37,7 +37,7 @@ var _ = Describe("DripDrip Transformer", func() {
db := test_config.NewTestDB(blockchain.Node())
test_config.CleanTestDB(db)
err = persistHeader(rpcClient, db, blockNumber)
err = persistHeader(db, blockNumber)
Expect(err).NotTo(HaveOccurred())
initializer := drip_drip.DripDripTransformerInitializer{Config: config}

View File

@ -39,7 +39,7 @@ var _ = Describe("Drip File Vow Transformer", func() {
db := test_config.NewTestDB(blockchain.Node())
test_config.CleanTestDB(db)
err = persistHeader(rpcClient, db, blockNumber)
err = persistHeader(db, blockNumber)
Expect(err).NotTo(HaveOccurred())
initializer := factories.Transformer{

View File

@ -39,7 +39,7 @@ var _ = Describe("FlopKick Transformer", func() {
db := test_config.NewTestDB(blockchain.Node())
test_config.CleanTestDB(db)
err = persistHeader(rpcClient, db, blockNumber)
err = persistHeader(db, blockNumber)
Expect(err).NotTo(HaveOccurred())
initializer := flop_kick.FlopKickTransformerInitializer{Config: config}
@ -74,7 +74,7 @@ var _ = Describe("FlopKick Transformer", func() {
db := test_config.NewTestDB(blockchain.Node())
test_config.CleanTestDB(db)
err = persistHeader(rpcClient, db, blockNumber)
err = persistHeader(db, blockNumber)
Expect(err).NotTo(HaveOccurred())
initializer := flop_kick.FlopKickTransformerInitializer{Config: config}

View File

@ -42,7 +42,7 @@ var _ = Describe("Frob Transformer", func() {
db := test_config.NewTestDB(blockchain.Node())
test_config.CleanTestDB(db)
err = persistHeader(rpcClient, db, blockNumber)
err = persistHeader(db, blockNumber)
Expect(err).NotTo(HaveOccurred())
initializer := frob.FrobTransformerInitializer{Config: config}

View File

@ -42,7 +42,7 @@ func getBlockChain(rpcClient client.RpcClient, ethClient *ethclient.Client) (cor
return blockChain, nil
}
func persistHeader(rpcClient client.RpcClient, db *postgres.DB, blockNumber int64) error {
func persistHeader(db *postgres.DB, blockNumber int64) error {
headerRepository := repositories.NewHeaderRepository(db)
_, err := headerRepository.CreateOrUpdateHeader(fakes.GetFakeHeader(blockNumber))
return err

View File

@ -39,7 +39,7 @@ var _ = Describe("PitFileDebtCeiling Transformer", func() {
db := test_config.NewTestDB(blockchain.Node())
test_config.CleanTestDB(db)
err = persistHeader(rpcClient, db, blockNumber)
err = persistHeader(db, blockNumber)
Expect(err).NotTo(HaveOccurred())
initializer := factories.Transformer{

View File

@ -39,7 +39,7 @@ var _ = Describe("PitFileIlk Transformer", func() {
db := test_config.NewTestDB(blockchain.Node())
test_config.CleanTestDB(db)
err = persistHeader(rpcClient, db, blockNumber)
err = persistHeader(db, blockNumber)
Expect(err).NotTo(HaveOccurred())
initializer := factories.Transformer{

View File

@ -39,7 +39,7 @@ var _ = Describe("PitFileStabilityFee Transformer", func() {
db := test_config.NewTestDB(blockchain.Node())
test_config.CleanTestDB(db)
err = persistHeader(rpcClient, db, blockNumber)
err = persistHeader(db, blockNumber)
Expect(err).NotTo(HaveOccurred())
initializer := factories.Transformer{

View File

@ -20,7 +20,6 @@ import (
"github.com/vulcanize/vulcanizedb/pkg/core"
"github.com/vulcanize/vulcanizedb/pkg/datastore/postgres"
"github.com/vulcanize/vulcanizedb/pkg/geth/client"
"github.com/vulcanize/vulcanizedb/pkg/transformers/price_feeds"
"github.com/vulcanize/vulcanizedb/test_config"
)
@ -29,7 +28,6 @@ var _ = Describe("Price feeds transformer", func() {
var (
db *postgres.DB
blockChain core.BlockChain
rpcClient client.RpcClient
)
BeforeEach(func() {
@ -43,7 +41,7 @@ var _ = Describe("Price feeds transformer", func() {
It("persists a ETH/USD price feed event", func() {
blockNumber := int64(8763054)
err := persistHeader(rpcClient, db, blockNumber)
err := persistHeader(db, blockNumber)
Expect(err).NotTo(HaveOccurred())
config := price_feeds.IPriceFeedConfig{
ContractAddresses: []string{"0x9FfFE440258B79c5d6604001674A4722FfC0f7Bc"},
@ -65,7 +63,7 @@ var _ = Describe("Price feeds transformer", func() {
It("persists a MKR/USD price feed event", func() {
blockNumber := int64(8763059)
err := persistHeader(rpcClient, db, blockNumber)
err := persistHeader(db, blockNumber)
Expect(err).NotTo(HaveOccurred())
config := price_feeds.IPriceFeedConfig{
ContractAddresses: []string{"0xB1997239Cfc3d15578A3a09730f7f84A90BB4975"},
@ -87,7 +85,7 @@ var _ = Describe("Price feeds transformer", func() {
It("persists a REP/USD price feed event", func() {
blockNumber := int64(8763062)
err := persistHeader(rpcClient, db, blockNumber)
err := persistHeader(db, blockNumber)
Expect(err).NotTo(HaveOccurred())
config := price_feeds.IPriceFeedConfig{
ContractAddresses: []string{"0xf88bBDc1E2718F8857F30A180076ec38d53cf296"},

View File

@ -39,7 +39,7 @@ var _ = Describe("Tend Transformer", func() {
db := test_config.NewTestDB(blockchain.Node())
test_config.CleanTestDB(db)
err = persistHeader(rpcClient, db, blockNumber)
err = persistHeader(db, blockNumber)
Expect(err).NotTo(HaveOccurred())
initializer := factories.Transformer{
@ -78,7 +78,7 @@ var _ = Describe("Tend Transformer", func() {
db := test_config.NewTestDB(blockchain.Node())
test_config.CleanTestDB(db)
err = persistHeader(rpcClient, db, blockNumber)
err = persistHeader(db, blockNumber)
Expect(err).NotTo(HaveOccurred())
initializer := factories.Transformer{

View File

@ -39,7 +39,7 @@ var _ = Describe("VatFlux Transformer", func() {
db := test_config.NewTestDB(blockchain.Node())
test_config.CleanTestDB(db)
err = persistHeader(rpcClient, db, blockNumber)
err = persistHeader(db, blockNumber)
Expect(err).NotTo(HaveOccurred())
initializer := factories.Transformer{

View File

@ -38,7 +38,7 @@ var _ = Describe("VatFold Transformer", func() {
db := test_config.NewTestDB(blockchain.Node())
test_config.CleanTestDB(db)
err = persistHeader(rpcClient, db, blockNumber)
err = persistHeader(db, blockNumber)
Expect(err).NotTo(HaveOccurred())
initializer := vat_fold.VatFoldTransformerInitializer{Config: config}

View File

@ -39,7 +39,7 @@ var _ = Describe("Vat Grab Transformer", func() {
db := test_config.NewTestDB(blockchain.Node())
test_config.CleanTestDB(db)
err = persistHeader(rpcClient, db, blockNumber)
err = persistHeader(db, blockNumber)
Expect(err).NotTo(HaveOccurred())
initializer := vat_grab.VatGrabTransformerInitializer{Config: config}

View File

@ -38,7 +38,7 @@ var _ = Describe("VatHeal Transformer", func() {
db := test_config.NewTestDB(blockchain.Node())
test_config.CleanTestDB(db)
err = persistHeader(rpcClient, db, blockNumber)
err = persistHeader(db, blockNumber)
Expect(err).NotTo(HaveOccurred())
initializer := vat_heal.VatHealTransformerInitializer{Config: config}

View File

@ -39,7 +39,7 @@ var _ = Describe("VatInit Transformer", func() {
db := test_config.NewTestDB(blockchain.Node())
test_config.CleanTestDB(db)
err = persistHeader(rpcClient, db, blockNumber)
err = persistHeader(db, blockNumber)
Expect(err).NotTo(HaveOccurred())
initializer := factories.Transformer{

View File

@ -40,7 +40,7 @@ var _ = Describe("VatMove Transformer", func() {
db := test_config.NewTestDB(blockchain.Node())
test_config.CleanTestDB(db)
err = persistHeader(rpcClient, db, blockNumber)
err = persistHeader(db, blockNumber)
Expect(err).NotTo(HaveOccurred())
initializer := factories.Transformer{

View File

@ -18,7 +18,7 @@ var _ = Describe("Vat slip transformer", func() {
blockChain core.BlockChain
)
BeforeEach(func() {
It("persists vat slip event", func() {
rpcClient, ethClient, err := getClients(ipc)
Expect(err).NotTo(HaveOccurred())
blockChain, err = getBlockChain(rpcClient, ethClient)
@ -26,16 +26,14 @@ var _ = Describe("Vat slip transformer", func() {
db = test_config.NewTestDB(blockChain.Node())
test_config.CleanTestDB(db)
err = persistHeader(rpcClient, db, 8953655)
Expect(err).NotTo(HaveOccurred())
})
blockNumber := int64(8953655)
config := vat_slip.VatSlipConfig
config.StartingBlockNumber = blockNumber
config.EndingBlockNumber = blockNumber
err = persistHeader(db, blockNumber)
Expect(err).NotTo(HaveOccurred())
It("persists vat slip event", func(done Done) {
config := shared.SingleTransformerConfig{
ContractAddresses: []string{"0xcd726790550afcd77e9a7a47e86a3f9010af126b"},
StartingBlockNumber: 8953655,
EndingBlockNumber: 8953655,
}
initializer := factories.Transformer{
Config: config,
Fetcher: &shared.Fetcher{},
@ -44,11 +42,11 @@ var _ = Describe("Vat slip transformer", func() {
}
transformer := initializer.NewTransformer(db, blockChain)
err := transformer.Execute()
err = transformer.Execute()
Expect(err).NotTo(HaveOccurred())
var headerID int64
err = db.Get(&headerID, `SELECT id FROM public.headers WHERE block_number = $1`, config.StartingBlockNumber)
err = db.Get(&headerID, `SELECT id FROM public.headers WHERE block_number = $1`, blockNumber)
Expect(err).NotTo(HaveOccurred())
var model vat_slip.VatSlipModel
err = db.Get(&model, `SELECT ilk, guy, rad, tx_idx FROM maker.vat_slip WHERE header_id = $1`, headerID)
@ -61,6 +59,5 @@ var _ = Describe("Vat slip transformer", func() {
err = db.Get(&headerChecked, `SELECT vat_slip_checked FROM public.checked_headers WHERE header_id = $1`, headerID)
Expect(err).NotTo(HaveOccurred())
Expect(headerChecked).To(BeTrue())
close(done)
}, 15)
})
})

View File

@ -41,7 +41,7 @@ var _ = Describe("VatTune Transformer", func() {
db := test_config.NewTestDB(blockchain.Node())
test_config.CleanTestDB(db)
err = persistHeader(rpcClient, db, blockNumber)
err = persistHeader(db, blockNumber)
Expect(err).NotTo(HaveOccurred())
initializer := factories.Transformer{