Add tests for pkg/geth/blockchain

- inject dependencies instead of initializing them in the constructor
This commit is contained in:
Rob Mulholand
2018-11-03 13:49:23 -05:00
committed by Ian Norden
parent 05186634bd
commit 5fe6394406
20 changed files with 538 additions and 106 deletions
+2 -2
View File
@@ -13,7 +13,7 @@ import (
var _ = Describe("Blocks validator", func() {
It("calls create or update for all blocks within the window", func() {
blockchain := fakes.NewBlockchainWithBlocks([]core.Block{
blockchain := fakes.NewMockBlockChainWithBlocks([]core.Block{
{Number: 4},
{Number: 5},
{Number: 6},
@@ -31,7 +31,7 @@ var _ = Describe("Blocks validator", func() {
})
It("returns the number of largest block", func() {
blockchain := fakes.NewBlockchainWithBlocks([]core.Block{
blockchain := fakes.NewMockBlockChainWithBlocks([]core.Block{
{Number: 1},
{Number: 2},
{Number: 3},