mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-12 21:01:21 +00:00
int64 height
uint64 is considered dangerous. the details will follow in a blog post.
This commit is contained in:
@ -16,21 +16,21 @@ func init() {
|
||||
|
||||
type testPeer struct {
|
||||
id string
|
||||
height uint64
|
||||
height int64
|
||||
}
|
||||
|
||||
func makePeers(numPeers int, minHeight, maxHeight uint64) map[string]testPeer {
|
||||
func makePeers(numPeers int, minHeight, maxHeight int64) map[string]testPeer {
|
||||
peers := make(map[string]testPeer, numPeers)
|
||||
for i := 0; i < numPeers; i++ {
|
||||
peerID := cmn.RandStr(12)
|
||||
height := minHeight + uint64(rand.Intn(int(maxHeight-minHeight)))
|
||||
height := minHeight + int64(rand.Intn(int(maxHeight-minHeight)))
|
||||
peers[peerID] = testPeer{peerID, height}
|
||||
}
|
||||
return peers
|
||||
}
|
||||
|
||||
func TestBasic(t *testing.T) {
|
||||
start := uint64(42)
|
||||
start := int64(42)
|
||||
peers := makePeers(10, start+1, 1000)
|
||||
timeoutsCh := make(chan string, 100)
|
||||
requestsCh := make(chan BlockRequest, 100)
|
||||
@ -87,7 +87,7 @@ func TestBasic(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestTimeout(t *testing.T) {
|
||||
start := uint64(42)
|
||||
start := int64(42)
|
||||
peers := makePeers(10, start+1, 1000)
|
||||
timeoutsCh := make(chan string, 100)
|
||||
requestsCh := make(chan BlockRequest, 100)
|
||||
|
Reference in New Issue
Block a user