test/e2e: fix secp failures (#5649)

This commit is contained in:
Marko
2020-11-16 12:31:32 +01:00
committed by GitHub
parent 8aa47c7da5
commit e0950515ff
12 changed files with 47 additions and 22 deletions
+6 -5
View File
@@ -96,12 +96,12 @@ func Setup(testnet *e2e.Testnet) error {
return err
}
err = (&p2p.NodeKey{PrivKey: node.Key}).SaveAs(filepath.Join(nodeDir, "config", "node_key.json"))
err = (&p2p.NodeKey{PrivKey: node.NodeKey}).SaveAs(filepath.Join(nodeDir, "config", "node_key.json"))
if err != nil {
return err
}
(privval.NewFilePV(node.Key,
(privval.NewFilePV(node.PrivvalKey,
filepath.Join(nodeDir, PrivvalKeyFile),
filepath.Join(nodeDir, PrivvalStateFile),
)).Save()
@@ -201,8 +201,8 @@ func MakeGenesis(testnet *e2e.Testnet) (types.GenesisDoc, error) {
for validator, power := range testnet.Validators {
genesis.Validators = append(genesis.Validators, types.GenesisValidator{
Name: validator.Name,
Address: validator.Key.PubKey().Address(),
PubKey: validator.Key.PubKey(),
Address: validator.PrivvalKey.PubKey().Address(),
PubKey: validator.PrivvalKey.PubKey(),
Power: power,
})
}
@@ -324,6 +324,7 @@ func MakeAppConfig(node *e2e.Node) ([]byte, error) {
"persist_interval": node.PersistInterval,
"snapshot_interval": node.SnapshotInterval,
"retain_blocks": node.RetainBlocks,
"key_type": node.PrivvalKey.Type(),
}
switch node.ABCIProtocol {
case e2e.ProtocolUNIX:
@@ -366,7 +367,7 @@ func MakeAppConfig(node *e2e.Node) ([]byte, error) {
for height, validators := range node.Testnet.ValidatorUpdates {
updateVals := map[string]int64{}
for node, power := range validators {
updateVals[base64.StdEncoding.EncodeToString(node.Key.PubKey().Bytes())] = power
updateVals[base64.StdEncoding.EncodeToString(node.PrivvalKey.PubKey().Bytes())] = power
}
validatorUpdates[fmt.Sprintf("%v", height)] = updateVals
}