Add SetDB test for vat move

This commit is contained in:
Edvard 2018-10-11 15:55:39 +02:00
parent 32654ffabc
commit 177d212cc4
4 changed files with 13 additions and 5 deletions

View File

@ -64,6 +64,4 @@ func (repository *MockVatMoveRepository) SetCheckedHeaderError(e error) {
repository.CheckedHeaderError = e repository.CheckedHeaderError = e
} }
func (repository *MockVatMoveRepository) SetDB(db *postgres.DB) { func (repository *MockVatMoveRepository) SetDB(db *postgres.DB) {}
// TODO Implement passed DB
}

View File

@ -19,6 +19,7 @@ import (
) )
var VatMoveConfig = shared.TransformerConfig{ var VatMoveConfig = shared.TransformerConfig{
TransformerName: "vat move",
ContractAddresses: []string{shared.VatContractAddress}, ContractAddresses: []string{shared.VatContractAddress},
ContractAbi: shared.VatABI, ContractAbi: shared.VatABI,
Topics: []string{shared.VatMoveSignature}, Topics: []string{shared.VatMoveSignature},

View File

@ -190,4 +190,13 @@ var _ = Describe("Vat Move", func() {
Expect(headerChecked).To(BeTrue()) Expect(headerChecked).To(BeTrue())
}) })
}) })
Describe("SetDB", func() {
It("sets the repository db", func() {
vatMoveRepository.DB = nil
Expect(vatMoveRepository.DB).To(BeNil())
vatMoveRepository.SetDB(db)
Expect(vatMoveRepository.DB).To(Equal(db))
})
})
}) })

View File

@ -47,7 +47,7 @@ var _ = Describe("Vat move transformer", func() {
It("gets missing headers for block numbers specified in config", func() { It("gets missing headers for block numbers specified in config", func() {
transformer := factories.Transformer{ transformer := factories.Transformer{
Config: vat_move.VatMoveConfig, Config: config,
Converter: &converter, Converter: &converter,
Repository: &repository, Repository: &repository,
Fetcher: &fetcher, Fetcher: &fetcher,