mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-19 22:44:24 +00:00
crypto: Remove Ed25519 and Secp256k1 suffix on GenPrivKey
This commit is contained in:
@@ -40,7 +40,7 @@ func TestGenesisGood(t *testing.T) {
|
||||
// create a base gendoc from struct
|
||||
baseGenDoc := &GenesisDoc{
|
||||
ChainID: "abc",
|
||||
Validators: []GenesisValidator{{ed25519.GenPrivKeyEd25519().PubKey(), 10, "myval"}},
|
||||
Validators: []GenesisValidator{{ed25519.GenPrivKey().PubKey(), 10, "myval"}},
|
||||
}
|
||||
genDocBytes, err = cdc.MarshalJSON(baseGenDoc)
|
||||
assert.NoError(t, err, "error marshalling genDoc")
|
||||
@@ -100,7 +100,7 @@ func randomGenesisDoc() *GenesisDoc {
|
||||
return &GenesisDoc{
|
||||
GenesisTime: time.Now().UTC(),
|
||||
ChainID: "abc",
|
||||
Validators: []GenesisValidator{{ed25519.GenPrivKeyEd25519().PubKey(), 10, "myval"}},
|
||||
Validators: []GenesisValidator{{ed25519.GenPrivKey().PubKey(), 10, "myval"}},
|
||||
ConsensusParams: DefaultConsensusParams(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ type MockPV struct {
|
||||
}
|
||||
|
||||
func NewMockPV() *MockPV {
|
||||
return &MockPV{ed25519.GenPrivKeyEd25519()}
|
||||
return &MockPV{ed25519.GenPrivKey()}
|
||||
}
|
||||
|
||||
// Implements PrivValidator.
|
||||
|
||||
@@ -12,8 +12,8 @@ import (
|
||||
)
|
||||
|
||||
func TestABCIPubKey(t *testing.T) {
|
||||
pkEd := ed25519.GenPrivKeyEd25519().PubKey()
|
||||
pkSecp := secp256k1.GenPrivKeySecp256k1().PubKey()
|
||||
pkEd := ed25519.GenPrivKey().PubKey()
|
||||
pkSecp := secp256k1.GenPrivKey().PubKey()
|
||||
testABCIPubKey(t, pkEd, ABCIPubKeyTypeEd25519)
|
||||
testABCIPubKey(t, pkSecp, ABCIPubKeyTypeSecp256k1)
|
||||
}
|
||||
@@ -26,7 +26,7 @@ func testABCIPubKey(t *testing.T, pk crypto.PubKey, typeStr string) {
|
||||
}
|
||||
|
||||
func TestABCIValidators(t *testing.T) {
|
||||
pkEd := ed25519.GenPrivKeyEd25519().PubKey()
|
||||
pkEd := ed25519.GenPrivKey().PubKey()
|
||||
|
||||
// correct validator
|
||||
tmValExpected := &Validator{
|
||||
@@ -112,7 +112,7 @@ func (pubKeyEddie) VerifyBytes(msg []byte, sig crypto.Signature) bool { return f
|
||||
func (pubKeyEddie) Equals(crypto.PubKey) bool { return false }
|
||||
|
||||
func TestABCIValidatorFromPubKeyAndPower(t *testing.T) {
|
||||
pubkey := ed25519.GenPrivKeyEd25519().PubKey()
|
||||
pubkey := ed25519.GenPrivKey().PubKey()
|
||||
|
||||
abciVal := TM2PB.ValidatorFromPubKeyAndPower(pubkey, 10)
|
||||
assert.Equal(t, int64(10), abciVal.Power)
|
||||
|
||||
@@ -88,7 +88,7 @@ func BenchmarkValidatorSetCopy(b *testing.B) {
|
||||
b.StopTimer()
|
||||
vset := NewValidatorSet([]*Validator{})
|
||||
for i := 0; i < 1000; i++ {
|
||||
privKey := ed25519.GenPrivKeyEd25519()
|
||||
privKey := ed25519.GenPrivKey()
|
||||
pubKey := privKey.PubKey()
|
||||
val := NewValidator(pubKey, 0)
|
||||
if !vset.Add(val) {
|
||||
@@ -369,7 +369,7 @@ func TestSafeSubClip(t *testing.T) {
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
func TestValidatorSetVerifyCommit(t *testing.T) {
|
||||
privKey := ed25519.GenPrivKeyEd25519()
|
||||
privKey := ed25519.GenPrivKey()
|
||||
pubKey := privKey.PubKey()
|
||||
v1 := NewValidator(pubKey, 1000)
|
||||
vset := NewValidatorSet([]*Validator{v1})
|
||||
|
||||
+1
-1
@@ -109,7 +109,7 @@ func TestVoteVerify(t *testing.T) {
|
||||
vote := examplePrevote()
|
||||
vote.ValidatorAddress = pubkey.Address()
|
||||
|
||||
err := vote.Verify("test_chain_id", ed25519.GenPrivKeyEd25519().PubKey())
|
||||
err := vote.Verify("test_chain_id", ed25519.GenPrivKey().PubKey())
|
||||
if assert.Error(t, err) {
|
||||
assert.Equal(t, ErrVoteInvalidValidatorAddress, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user