ipld-eth-server/observers/blockchain_db_observer.go

19 lines
453 B
Go
Raw Normal View History

package observers
import (
"github.com/8thlight/vulcanizedb/core"
2017-11-03 13:01:35 +00:00
"github.com/8thlight/vulcanizedb/repositories"
)
type BlockchainDbObserver struct {
repository repositories.Repository
}
func NewBlockchainDbObserver(repository repositories.Repository) BlockchainDbObserver {
return BlockchainDbObserver{repository: repository}
}
func (observer BlockchainDbObserver) NotifyBlockAdded(block core.Block) {
observer.repository.CreateBlock(block)
}