Separate DB access into several repos (#28)

* Separate files for InMemory

* Start using separate repos for collaborating objects

* Before Updating schema

* Separate various repos
This commit is contained in:
Matt K
2018-02-12 10:54:05 -06:00
committed by GitHub
parent 605b0a96ae
commit ed907535e3
34 changed files with 538 additions and 501 deletions
+5 -4
View File
@@ -19,18 +19,19 @@ func init() {
var _ = Describe("Reading from the Geth blockchain", func() {
var blockchain *geth.Blockchain
var repository *inmemory.InMemory
var inMemory *inmemory.InMemory
BeforeEach(func() {
cfg, _ := config.NewConfig("private")
blockchain = geth.NewBlockchain(cfg.Client.IPCPath)
repository = inmemory.NewInMemory()
inMemory = inmemory.NewInMemory()
})
It("reads two blocks", func(done Done) {
validator := history.NewBlockValidator(blockchain, repository, 2)
blocks := &inmemory.BlockRepository{InMemory: inMemory}
validator := history.NewBlockValidator(blockchain, blocks, 2)
validator.ValidateBlocks()
Expect(repository.BlockCount()).To(Equal(2))
Expect(blocks.BlockCount()).To(Equal(2))
close(done)
}, 15)