mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-08 02:51:20 +00:00
fix tests
This commit is contained in:
parent
9b2ed9932d
commit
1efde5e059
@ -13,7 +13,7 @@ import (
|
|||||||
func TestNetworkNewBlock(t *testing.T) {
|
func TestNetworkNewBlock(t *testing.T) {
|
||||||
n := monitor.NewNetwork()
|
n := monitor.NewNetwork()
|
||||||
|
|
||||||
n.NewBlock(tmtypes.Block{
|
n.NewBlock(&tmtypes.Block{
|
||||||
Header: tmtypes.Header{Height: 5},
|
Header: tmtypes.Header{Height: 5},
|
||||||
})
|
})
|
||||||
assert.Equal(t, int64(5), n.Height)
|
assert.Equal(t, int64(5), n.Height)
|
||||||
|
@ -28,16 +28,16 @@ func TestNodeStartStop(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestNodeNewBlockReceived(t *testing.T) {
|
func TestNodeNewBlockReceived(t *testing.T) {
|
||||||
blockCh := make(chan tmtypes.Header, 100)
|
blockCh := make(chan *tmtypes.Block, 100)
|
||||||
n, emMock := startValidatorNode(t)
|
n, emMock := startValidatorNode(t)
|
||||||
defer n.Stop()
|
defer n.Stop()
|
||||||
n.SendBlocksTo(blockCh)
|
n.SendBlocksTo(blockCh)
|
||||||
|
|
||||||
blockHeader := tmtypes.Header{Height: 5}
|
block := &tmtypes.Block{Header: tmtypes.Header{Height: 5}}
|
||||||
emMock.Call("eventCallback", &em.EventMetric{}, tmtypes.EventDataNewBlockHeader{Header: blockHeader})
|
emMock.Call("eventCallback", &em.EventMetric{}, tmtypes.EventDataNewBlock{Block: block})
|
||||||
|
|
||||||
assert.Equal(t, int64(5), n.Height)
|
assert.Equal(t, int64(5), n.Height)
|
||||||
assert.Equal(t, blockHeader, <-blockCh)
|
assert.Equal(t, block, <-blockCh)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestNodeNewBlockLatencyReceived(t *testing.T) {
|
func TestNodeNewBlockLatencyReceived(t *testing.T) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user