2017-10-23 15:56:29 +00:00
|
|
|
package fakes
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/8thlight/vulcanizedb/core"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Blockchain struct {
|
|
|
|
observers []core.BlockchainObserver
|
|
|
|
}
|
|
|
|
|
|
|
|
func (blockchain *Blockchain) RegisterObserver(observer core.BlockchainObserver) {
|
|
|
|
blockchain.observers = append(blockchain.observers, observer)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (blockchain *Blockchain) AddBlock(block core.Block) {
|
|
|
|
for _, observer := range blockchain.observers {
|
|
|
|
observer.NotifyBlockAdded(block)
|
|
|
|
}
|
|
|
|
}
|
2017-10-23 18:58:33 +00:00
|
|
|
|
2017-10-24 14:24:07 +00:00
|
|
|
func (_ *Blockchain) SubscribeToEvents() {}
|