int64 height

uint64 is considered dangerous. the details will follow in a blog post.
This commit is contained in:
Anton Kaliaev
2017-12-01 19:04:53 -06:00
parent e9f8e56895
commit 922af7c405
67 changed files with 274 additions and 274 deletions

View File

@ -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)