ipld-eth-server/observers/blockchain_db_observer.go
2017-11-06 09:52:02 -06:00

16 lines
331 B
Go

package observers
import (
"github.com/8thlight/vulcanizedb/core"
"github.com/8thlight/vulcanizedb/repositories"
"github.com/jmoiron/sqlx"
)
type BlockchainDBObserver struct {
Db *sqlx.DB
}
func (observer BlockchainDBObserver) NotifyBlockAdded(block core.Block) {
repositories.NewPostgres(observer.Db).CreateBlock(block)
}