Browse Source

privval: missing privval type check in SetPrivValidator (#6645)

pull/6649/head
JayT106 3 years ago
committed by GitHub
parent
commit
4334135651
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions
  1. +4
    -1
      internal/consensus/state.go
  2. +6
    -5
      types/priv_validator.go

+ 4
- 1
internal/consensus/state.go View File

@ -25,6 +25,7 @@ import (
"github.com/tendermint/tendermint/libs/service"
tmtime "github.com/tendermint/tendermint/libs/time"
"github.com/tendermint/tendermint/privval"
tmgrpc "github.com/tendermint/tendermint/privval/grpc"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
sm "github.com/tendermint/tendermint/state"
"github.com/tendermint/tendermint/types"
@ -281,7 +282,9 @@ func (cs *State) SetPrivValidator(priv types.PrivValidator) {
case *privval.FilePV:
cs.privValidatorType = types.FileSignerClient
case *privval.SignerClient:
cs.privValidatorType = types.SignerClient
cs.privValidatorType = types.SignerSocketClient
case *tmgrpc.SignerClient:
cs.privValidatorType = types.SignerGRPCClient
case types.MockPV:
cs.privValidatorType = types.MockSignerClient
case *types.ErroringMockPV:


+ 6
- 5
types/priv_validator.go View File

@ -15,11 +15,12 @@ import (
type PrivValidatorType uint8
const (
MockSignerClient = PrivValidatorType(0x00) // mock singer
FileSignerClient = PrivValidatorType(0x01) // singer client via file
RetrySignerClient = PrivValidatorType(0x02) // singer client via socket
SignerClient = PrivValidatorType(0x03) // singer client via gRPC
ErrorMockSignerClient = PrivValidatorType(0x04) // error mock singer
MockSignerClient = PrivValidatorType(0x00) // mock signer
FileSignerClient = PrivValidatorType(0x01) // signer client via file
RetrySignerClient = PrivValidatorType(0x02) // signer client with retry via socket
SignerSocketClient = PrivValidatorType(0x03) // signer client via socket
ErrorMockSignerClient = PrivValidatorType(0x04) // error mock signer
SignerGRPCClient = PrivValidatorType(0x05) // signer client via gRPC
)
// PrivValidator defines the functionality of a local Tendermint validator


Loading…
Cancel
Save