ipld-eth-server/fakes/blockchain_observer.go
Eric Meyer de2cb3b5cc Start introducing domain concepts
* Potential observers include a logger and/or an observer that writes to the DB
2017-10-23 12:08:59 -05:00

20 lines
451 B
Go

package fakes
import (
"github.com/8thlight/vulcanizedb/core"
)
type BlockchainObserver struct {
wasToldBlockAdded bool
LastAddedBlock core.Block
}
func (blockchainObserver *BlockchainObserver) WasToldBlockAdded() bool {
return blockchainObserver.wasToldBlockAdded
}
func (blockchainObserver *BlockchainObserver) NotifyBlockAdded(block core.Block) {
blockchainObserver.LastAddedBlock = block
blockchainObserver.wasToldBlockAdded = true
}