mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-13 05:11:21 +00:00
int64 height
uint64 is considered dangerous. the details will follow in a blog post.
This commit is contained in:
@ -138,7 +138,7 @@ func TestValidatorChangesSaveLoad(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
// change vals at these heights
|
||||
changeHeights := []uint64{1, 2, 4, 5, 10, 15, 16, 17, 20}
|
||||
changeHeights := []int64{1, 2, 4, 5, 10, 15, 16, 17, 20}
|
||||
N := len(changeHeights)
|
||||
|
||||
// each valset is just one validator.
|
||||
@ -155,7 +155,7 @@ func TestValidatorChangesSaveLoad(t *testing.T) {
|
||||
highestHeight := changeHeights[N-1] + 5
|
||||
changeIndex := 0
|
||||
pubkey := pubkeys[changeIndex]
|
||||
for i := uint64(1); i < highestHeight; i++ {
|
||||
for i := int64(1); i < highestHeight; i++ {
|
||||
// when we get to a change height,
|
||||
// use the next pubkey
|
||||
if changeIndex < len(changeHeights) && i == changeHeights[changeIndex] {
|
||||
@ -171,7 +171,7 @@ func TestValidatorChangesSaveLoad(t *testing.T) {
|
||||
testCases := make([]valChangeTestCase, highestHeight)
|
||||
changeIndex = 0
|
||||
pubkey = pubkeys[changeIndex]
|
||||
for i := uint64(1); i < highestHeight+1; i++ {
|
||||
for i := int64(1); i < highestHeight+1; i++ {
|
||||
// we we get to the height after a change height
|
||||
// use the next pubkey (note our counter starts at 0 this time)
|
||||
if changeIndex < len(changeHeights) && i == changeHeights[changeIndex]+1 {
|
||||
@ -192,7 +192,7 @@ func TestValidatorChangesSaveLoad(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func makeHeaderPartsResponses(state *State, height uint64,
|
||||
func makeHeaderPartsResponses(state *State, height int64,
|
||||
pubkey crypto.PubKey) (*types.Header, types.PartSetHeader, *ABCIResponses) {
|
||||
|
||||
block := makeBlock(height, state)
|
||||
@ -216,6 +216,6 @@ func makeHeaderPartsResponses(state *State, height uint64,
|
||||
}
|
||||
|
||||
type valChangeTestCase struct {
|
||||
height uint64
|
||||
height int64
|
||||
vals crypto.PubKey
|
||||
}
|
||||
|
Reference in New Issue
Block a user