e2e: stabilize validator update form (#7340) (#7351)

This might be a source of non-determinism in the e2e test.

(cherry picked from commit c4033f95c1)

Co-authored-by: Sam Kleinman <garen@tychoish.com>
This commit is contained in:
mergify[bot]
2021-11-30 14:53:40 -05:00
committed by GitHub
parent 7bf7ff6639
commit ebe57960f7
+9
View File
@@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"path/filepath"
"sort"
"strconv"
"github.com/tendermint/tendermint/abci/example/code"
@@ -279,6 +280,14 @@ func (app *Application) validatorUpdates(height uint64) (abci.ValidatorUpdates,
}
valUpdates = append(valUpdates, abci.UpdateValidator(keyBytes, int64(power), app.cfg.KeyType))
}
// the validator updates could be returned in arbitrary order,
// and that seems potentially bad. This orders the validator
// set.
sort.Slice(valUpdates, func(i, j int) bool {
return valUpdates[i].PubKey.Compare(valUpdates[j].PubKey) < 0
})
return valUpdates, nil
}