fix tests

This commit is contained in:
Anton Kaliaev 2019-07-29 12:23:52 +04:00
parent 9b2ed9932d
commit 1efde5e059
No known key found for this signature in database
GPG Key ID: 7B6881D965918214
2 changed files with 5 additions and 5 deletions

View File

@ -13,7 +13,7 @@ import (
func TestNetworkNewBlock(t *testing.T) {
n := monitor.NewNetwork()
n.NewBlock(tmtypes.Block{
n.NewBlock(&tmtypes.Block{
Header: tmtypes.Header{Height: 5},
})
assert.Equal(t, int64(5), n.Height)

View File

@ -28,16 +28,16 @@ func TestNodeStartStop(t *testing.T) {
}
func TestNodeNewBlockReceived(t *testing.T) {
blockCh := make(chan tmtypes.Header, 100)
blockCh := make(chan *tmtypes.Block, 100)
n, emMock := startValidatorNode(t)
defer n.Stop()
n.SendBlocksTo(blockCh)
blockHeader := tmtypes.Header{Height: 5}
emMock.Call("eventCallback", &em.EventMetric{}, tmtypes.EventDataNewBlockHeader{Header: blockHeader})
block := &tmtypes.Block{Header: tmtypes.Header{Height: 5}}
emMock.Call("eventCallback", &em.EventMetric{}, tmtypes.EventDataNewBlock{Block: block})
assert.Equal(t, int64(5), n.Height)
assert.Equal(t, blockHeader, <-blockCh)
assert.Equal(t, block, <-blockCh)
}
func TestNodeNewBlockLatencyReceived(t *testing.T) {