ipld-eth-server/fakes/blockchain.go
Eric Meyer 0262a99321 Close subscription in integration test
* This was causing issues in future tests,
   since the subscription was causing blocks
   and transactions to be added to the DB
2017-11-03 08:56:58 -05:00

23 lines
482 B
Go

package fakes
import "github.com/8thlight/vulcanizedb/core"
type Blockchain struct {
outputBlocks chan core.Block
WasToldToStop bool
}
func (blockchain *Blockchain) SubscribeToBlocks(outputBlocks chan core.Block) {
blockchain.outputBlocks = outputBlocks
}
func (blockchain Blockchain) AddBlock(block core.Block) {
blockchain.outputBlocks <- block
}
func (*Blockchain) StartListening() {}
func (blockchain *Blockchain) StopListening() {
blockchain.WasToldToStop = true
}