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
}
func (repository *MockVatMoveRepository) SetDB(db *postgres.DB) {
// TODO Implement passed DB
}
func (repository *MockVatMoveRepository) SetDB(db *postgres.DB) {}

View File

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

View File

@ -190,4 +190,13 @@ var _ = Describe("Vat Move", func() {
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,10 +47,10 @@ var _ = Describe("Vat move transformer", func() {
It("gets missing headers for block numbers specified in config", func() {
transformer := factories.Transformer{
Config: vat_move.VatMoveConfig,
Config: config,
Converter: &converter,
Repository: &repository,
Fetcher: &fetcher,
Fetcher: &fetcher,
}.NewTransformer(nil, nil)
err := transformer.Execute()