Browse Source

e2e: use ed25519 for secretConn (remote signer) (#5678)

## Description

Hardcode ed25519 to dialTCPFn in e2e tests. 

I will backport `DefaultRequestHandler` fixes

This will be replaced when grpc is implemented.
pull/5684/head
Marko 4 years ago
committed by GitHub
parent
commit
b2d72dce7e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions
  1. +7
    -4
      privval/signer_requestHandler.go
  2. +2
    -1
      test/e2e/app/main.go

+ 7
- 4
privval/signer_requestHandler.go View File

@ -24,14 +24,17 @@ func DefaultValidationRequestHandler(
switch r := req.Sum.(type) {
case *privvalproto.Message_PubKeyRequest:
if r.PubKeyRequest.GetChainId() != chainID {
res = mustWrapMsg(&privvalproto.SignedVoteResponse{
Vote: tmproto.Vote{}, Error: &privvalproto.RemoteSignerError{
res = mustWrapMsg(&privvalproto.PubKeyResponse{
PubKey: cryptoproto.PublicKey{}, Error: &privvalproto.RemoteSignerError{
Code: 0, Description: "unable to provide pubkey"}})
return res, fmt.Errorf("want chainID: %s, got chainID: %s", r.PubKeyRequest.GetChainId(), chainID)
}
var pubKey crypto.PubKey
pubKey, err = privVal.GetPubKey()
if err != nil {
return res, err
}
pk, err := cryptoenc.PubKeyToProto(pubKey)
if err != nil {
return res, err
@ -64,8 +67,8 @@ func DefaultValidationRequestHandler(
case *privvalproto.Message_SignProposalRequest:
if r.SignProposalRequest.GetChainId() != chainID {
res = mustWrapMsg(&privvalproto.SignedVoteResponse{
Vote: tmproto.Vote{}, Error: &privvalproto.RemoteSignerError{
res = mustWrapMsg(&privvalproto.SignedProposalResponse{
Proposal: tmproto.Proposal{}, Error: &privvalproto.RemoteSignerError{
Code: 0,
Description: "unable to sign proposal"}})
return res, fmt.Errorf("want chainID: %s, got chainID: %s", r.SignProposalRequest.GetChainId(), chainID)


+ 2
- 1
test/e2e/app/main.go View File

@ -12,6 +12,7 @@ import (
"github.com/tendermint/tendermint/abci/server"
"github.com/tendermint/tendermint/config"
"github.com/tendermint/tendermint/crypto/ed25519"
tmflags "github.com/tendermint/tendermint/libs/cli/flags"
"github.com/tendermint/tendermint/libs/log"
tmnet "github.com/tendermint/tendermint/libs/net"
@ -178,7 +179,7 @@ func startSigner(cfg *Config) error {
var dialFn privval.SocketDialer
switch protocol {
case "tcp":
dialFn = privval.DialTCPFn(address, 3*time.Second, filePV.Key.PrivKey)
dialFn = privval.DialTCPFn(address, 3*time.Second, ed25519.GenPrivKey())
case "unix":
dialFn = privval.DialUnixFn(address)
default:


Loading…
Cancel
Save