diff --git a/container/blockchain.go b/container/blockchain.go index 434a4a91..26e7519a 100644 --- a/container/blockchain.go +++ b/container/blockchain.go @@ -44,6 +44,10 @@ const ( defaultPassword = "" ) +type NodeIncubator interface { + CreateNodes(int, ...Option) ([]Ethereum, error) +} + type Blockchain interface { AddValidators(numOfValidators int) ([]Ethereum, error) RemoveValidators(candidates []Ethereum, t time.Duration) error @@ -52,7 +56,6 @@ type Blockchain interface { Stop(bool) error Validators() []Ethereum Finalize() - CreateNodes(int, ...Option) ([]Ethereum, error) } func NewBlockchain(network *DockerNetwork, numOfValidators int, options ...Option) (bc *blockchain) { diff --git a/tests/functional/block_sync_test.go b/tests/functional/block_sync_test.go index 17065ea9..4e1c7f72 100644 --- a/tests/functional/block_sync_test.go +++ b/tests/functional/block_sync_test.go @@ -52,7 +52,11 @@ var _ = Describe("Block synchronization testing", func() { BeforeEach(func() { var err error - nodes, err = blockchain.CreateNodes(numberOfNodes, + + incubator, ok := blockchain.(container.NodeIncubator) + Expect(ok).To(BeTrue()) + + nodes, err = incubator.CreateNodes(numberOfNodes, container.ImageRepository("quay.io/amis/geth"), container.ImageTag("istanbul_develop"), container.DataDir("/data"), diff --git a/tests/quorum/functional/block_sync_test.go b/tests/quorum/functional/block_sync_test.go index bf714e19..b11376fc 100644 --- a/tests/quorum/functional/block_sync_test.go +++ b/tests/quorum/functional/block_sync_test.go @@ -57,7 +57,11 @@ var _ = Describe("Block synchronization testing", func() { BeforeEach(func() { var err error - nodes, err = blockchain.CreateNodes(numberOfNodes, + + incubator, ok := blockchain.(container.NodeIncubator) + Expect(ok).To(BeTrue()) + + nodes, err = incubator.CreateNodes(numberOfNodes, container.ImageRepository("quay.io/amis/geth"), container.ImageTag("istanbul_develop"), container.DataDir("/data"),