diff --git a/.circleci/config.yml b/.circleci/config.yml index ead4cd72b..3ea794bf3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -372,7 +372,7 @@ jobs: # Build Tendermint make build-linux # Build contract-tests - docker run --rm -v "$PWD":/go/src/github.com/tendermint/tendermint -w /go/src/github.com/tendermint/tendermint ubuntu:19.10 ./scripts/prepare_dredd_test.sh + docker run --rm -v "$PWD":/go/src/github.com/tendermint/tendermint -w /go/src/github.com/tendermint/tendermint ubuntu:20.04 ./scripts/prepare_dredd_test.sh # This docker image works with go 1.7, we can install here the hook handler that contract-tests is going to use go get github.com/snikch/goodman/cmd/goodman make contract-tests diff --git a/cmd/tendermint/commands/gen_validator.go b/cmd/tendermint/commands/gen_validator.go index 72ba66340..be6508991 100644 --- a/cmd/tendermint/commands/gen_validator.go +++ b/cmd/tendermint/commands/gen_validator.go @@ -17,7 +17,7 @@ var GenValidatorCmd = &cobra.Command{ } func genValidator(cmd *cobra.Command, args []string) { - pv, _ := privval.GenFilePV("", "", privval.PrevKeyTypeEd25519) + pv, _ := privval.GenFilePV("", "", privval.PrivKeyTypeEd25519) jsbz, err := cdc.MarshalJSON(pv) if err != nil { panic(err) diff --git a/cmd/tendermint/commands/testnet.go b/cmd/tendermint/commands/testnet.go index 688d06eda..31bd25b52 100644 --- a/cmd/tendermint/commands/testnet.go +++ b/cmd/tendermint/commands/testnet.go @@ -73,7 +73,7 @@ func init() { "P2P Port") TestnetFilesCmd.Flags().BoolVar(&randomMonikers, "random-monikers", false, "Randomize the moniker for each generated node") - TestnetFilesCmd.Flags().StringVar(&privKeyType, "priv_key_type", privval.PrevKeyTypeEd25519, + TestnetFilesCmd.Flags().StringVar(&privKeyType, "priv_key_type", privval.PrivKeyTypeEd25519, "Specify validator's private key type (ed25519 | composite)") } diff --git a/config/config.go b/config/config.go index 693b61f2b..d0d529ed8 100644 --- a/config/config.go +++ b/config/config.go @@ -236,7 +236,7 @@ func DefaultBaseConfig() BaseConfig { FilterPeers: false, DBBackend: "goleveldb", DBPath: "data", - PrivKeyType: privval.PrevKeyTypeEd25519, + PrivKeyType: privval.PrivKeyTypeEd25519, } } diff --git a/consensus/common_test.go b/consensus/common_test.go index c6080245c..fe926dcb2 100644 --- a/consensus/common_test.go +++ b/consensus/common_test.go @@ -803,7 +803,7 @@ func randConsensusNetWithPeers( panic(err) } - privVal, _ = privval.GenFilePV(tempKeyFile.Name(), tempStateFile.Name(), privval.PrevKeyTypeEd25519) + privVal, _ = privval.GenFilePV(tempKeyFile.Name(), tempStateFile.Name(), privval.PrivKeyTypeEd25519) } app := appFunc(path.Join(config.DBDir(), fmt.Sprintf("%s_%d", testName, i))) diff --git a/privval/file.go b/privval/file.go index aa2b90e26..d89e3e2e6 100644 --- a/privval/file.go +++ b/privval/file.go @@ -28,8 +28,8 @@ const ( ) const ( - PrevKeyTypeEd25519 string = "ed25519" - PrevKeyTypeComposite string = "composite" + PrivKeyTypeEd25519 string = "ed25519" + PrivKeyTypeComposite string = "composite" ) // A vote is either stepPrevote or stepPrecommit. @@ -160,9 +160,9 @@ type FilePV struct { func GenFilePV(keyFilePath, stateFilePath, privKeyType string) (filePV *FilePV, err error) { var privKey crypto.PrivKey switch strings.ToLower(privKeyType) { - case PrevKeyTypeEd25519: + case PrivKeyTypeEd25519: privKey = ed25519.GenPrivKey() - case PrevKeyTypeComposite: + case PrivKeyTypeComposite: privKey = composite.NewPrivKeyComposite(bls.GenPrivKey(), ed25519.GenPrivKey()) default: return nil, fmt.Errorf("undefined private key type: %s", privKeyType) diff --git a/privval/file_test.go b/privval/file_test.go index bb5c1e1a7..9b3ba2498 100644 --- a/privval/file_test.go +++ b/privval/file_test.go @@ -25,7 +25,7 @@ func TestGenLoadValidator(t *testing.T) { tempStateFile, err := ioutil.TempFile("", "priv_validator_state_") require.Nil(t, err) - privVal, err := GenFilePV(tempKeyFile.Name(), tempStateFile.Name(), PrevKeyTypeEd25519) + privVal, err := GenFilePV(tempKeyFile.Name(), tempStateFile.Name(), PrivKeyTypeEd25519) require.Nil(t, err) height := int64(100) @@ -44,7 +44,7 @@ func TestResetValidator(t *testing.T) { tempStateFile, err := ioutil.TempFile("", "priv_validator_state_") require.Nil(t, err) - privVal, err := GenFilePV(tempKeyFile.Name(), tempStateFile.Name(), PrevKeyTypeEd25519) + privVal, err := GenFilePV(tempKeyFile.Name(), tempStateFile.Name(), PrivKeyTypeEd25519) require.Nil(t, err) emptyState := FilePVLastSignState{filePath: tempStateFile.Name()} @@ -85,11 +85,11 @@ func TestLoadOrGenValidator(t *testing.T) { t.Error(err) } - privVal, err := LoadOrGenFilePV(tempKeyFilePath, tempStateFilePath, PrevKeyTypeEd25519) + privVal, err := LoadOrGenFilePV(tempKeyFilePath, tempStateFilePath, PrivKeyTypeEd25519) require.Nil(t, err) addr := privVal.GetAddress() - privVal, err = LoadOrGenFilePV(tempKeyFilePath, tempStateFilePath, PrevKeyTypeEd25519) + privVal, err = LoadOrGenFilePV(tempKeyFilePath, tempStateFilePath, PrivKeyTypeEd25519) require.Nil(t, err) assert.Equal(addr, privVal.GetAddress(), "expected privval addr to be the same") @@ -169,7 +169,7 @@ func TestSignVote(t *testing.T) { tempStateFile, err := ioutil.TempFile("", "priv_validator_state_") require.Nil(t, err) - privVal, err := GenFilePV(tempKeyFile.Name(), tempStateFile.Name(), PrevKeyTypeEd25519) + privVal, err := GenFilePV(tempKeyFile.Name(), tempStateFile.Name(), PrivKeyTypeEd25519) require.Nil(t, err) block1 := types.BlockID{Hash: []byte{1, 2, 3}, PartsHeader: types.PartSetHeader{}} @@ -216,7 +216,7 @@ func TestSignProposal(t *testing.T) { tempStateFile, err := ioutil.TempFile("", "priv_validator_state_") require.Nil(t, err) - privVal, err := GenFilePV(tempKeyFile.Name(), tempStateFile.Name(), PrevKeyTypeEd25519) + privVal, err := GenFilePV(tempKeyFile.Name(), tempStateFile.Name(), PrivKeyTypeEd25519) require.Nil(t, err) block1 := types.BlockID{Hash: []byte{1, 2, 3}, PartsHeader: types.PartSetHeader{Total: 5, Hash: []byte{1, 2, 3}}} @@ -259,7 +259,7 @@ func TestGenerateVRFProof(t *testing.T) { tempStateFile, err := ioutil.TempFile("", "priv_validator_state_") require.Nil(t, err) - privVal, err := GenFilePV(tempKeyFile.Name(), tempStateFile.Name(), PrevKeyTypeEd25519) + privVal, err := GenFilePV(tempKeyFile.Name(), tempStateFile.Name(), PrivKeyTypeEd25519) require.Nil(t, err) success := [][]byte{{}, {0x00}, make([]byte, 100)} @@ -279,7 +279,7 @@ func TestDifferByTimestamp(t *testing.T) { tempStateFile, err := ioutil.TempFile("", "priv_validator_state_") require.Nil(t, err) - privVal, err := GenFilePV(tempKeyFile.Name(), tempStateFile.Name(), PrevKeyTypeEd25519) + privVal, err := GenFilePV(tempKeyFile.Name(), tempStateFile.Name(), PrivKeyTypeEd25519) require.Nil(t, err) block1 := types.BlockID{Hash: []byte{1, 2, 3}, PartsHeader: types.PartSetHeader{Total: 5, Hash: []byte{1, 2, 3}}}