forked from cerc-io/ipld-eth-server
Add integration test
* Update Travis to run integration tests
This commit is contained in:
+1
-2
@@ -18,5 +18,4 @@ func (blockchain *Blockchain) AddBlock(block core.Block) {
|
||||
}
|
||||
}
|
||||
|
||||
func (_ *Blockchain) SubscribeToEvents() {
|
||||
}
|
||||
func (_ *Blockchain) SubscribeToEvents() {}
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
type BlockchainObserver struct {
|
||||
wasToldBlockAdded bool
|
||||
LastAddedBlock core.Block
|
||||
blocks []core.Block
|
||||
}
|
||||
|
||||
func (blockchainObserver *BlockchainObserver) WasToldBlockAdded() bool {
|
||||
@@ -14,6 +14,10 @@ func (blockchainObserver *BlockchainObserver) WasToldBlockAdded() bool {
|
||||
}
|
||||
|
||||
func (blockchainObserver *BlockchainObserver) NotifyBlockAdded(block core.Block) {
|
||||
blockchainObserver.LastAddedBlock = block
|
||||
blockchainObserver.blocks = append(blockchainObserver.blocks, block)
|
||||
blockchainObserver.wasToldBlockAdded = true
|
||||
}
|
||||
|
||||
func (observer *BlockchainObserver) LastAddedBlock() core.Block {
|
||||
return observer.blocks[len(observer.blocks)-1]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user