Nest packages under pkg

This commit is contained in:
Eric Meyer
2017-11-06 13:06:03 -06:00
parent cf5f2f28db
commit f4a603efcb
36 changed files with 45 additions and 54 deletions
+23
View File
@@ -0,0 +1,23 @@
package fakes
import "github.com/8thlight/vulcanizedb/pkg/core"
type BlockchainObserver struct {
CurrentBlocks []core.Block
WasNotified chan bool
}
func (observer *BlockchainObserver) LastBlock() core.Block {
return observer.CurrentBlocks[len(observer.CurrentBlocks)-1]
}
func NewFakeBlockchainObserver() *BlockchainObserver {
return &BlockchainObserver{
WasNotified: make(chan bool),
}
}
func (observer *BlockchainObserver) NotifyBlockAdded(block core.Block) {
observer.CurrentBlocks = append(observer.CurrentBlocks, block)
observer.WasNotified <- true
}