tendermint: update to rc3 (#6892)
* modify light imports * change abci.header to tmproto.header * use rc * rc * fix import * Merge PR #6893: fix key imports * fix rc2 * tendermint: update 3 (#6899) * tendermint: update 4 (#6919) Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com> * tendermint: update 5 (#6923) Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * bump to latest master * tendermint: update (#6972) Co-authored-by: Aleksandr Bezobchuk <aleks.bezobchuk@gmail.com> Co-authored-by: Cory Levinson <cjlevinson@gmail.com> * Update x/ibc/07-tendermint/types/test_utils.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * address comment * go mod * bring back things * fix test * update tm proto files Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com> Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Aleksandr Bezobchuk <aleks.bezobchuk@gmail.com> Co-authored-by: Cory Levinson <cjlevinson@gmail.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>
This commit is contained in:
co-authored by
Alexander Bezobchuk
Federico Kunze
Aleksandr Bezobchuk
Cory Levinson
Federico Kunze
parent
f87624e9de
commit
8de96d16f9
@@ -2,6 +2,7 @@ package std
|
||||
|
||||
import (
|
||||
abci "github.com/tendermint/tendermint/abci/types"
|
||||
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/baseapp"
|
||||
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
|
||||
@@ -18,10 +19,10 @@ func ConsensusParamsKeyTable() paramstypes.KeyTable {
|
||||
baseapp.ParamStoreKeyBlockParams, abci.BlockParams{}, baseapp.ValidateBlockParams,
|
||||
),
|
||||
paramstypes.NewParamSetPair(
|
||||
baseapp.ParamStoreKeyEvidenceParams, abci.EvidenceParams{}, baseapp.ValidateEvidenceParams,
|
||||
baseapp.ParamStoreKeyEvidenceParams, tmproto.EvidenceParams{}, baseapp.ValidateEvidenceParams,
|
||||
),
|
||||
paramstypes.NewParamSetPair(
|
||||
baseapp.ParamStoreKeyValidatorParams, abci.ValidatorParams{}, baseapp.ValidateValidatorParams,
|
||||
baseapp.ParamStoreKeyValidatorParams, tmproto.ValidatorParams{}, baseapp.ValidateValidatorParams,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
+18
-15
@@ -23,27 +23,30 @@ func (cdc DefaultPublicKeyCodec) Decode(key *types.PublicKey) (crypto.PubKey, er
|
||||
switch key := key.Sum.(type) {
|
||||
case *types.PublicKey_Secp256K1:
|
||||
n := len(key.Secp256K1)
|
||||
if n != secp256k1.PubKeySecp256k1Size {
|
||||
if n != secp256k1.PubKeySize {
|
||||
return nil, fmt.Errorf("wrong length %d for secp256k1 public key", n)
|
||||
}
|
||||
var res secp256k1.PubKeySecp256k1
|
||||
copy(res[:], key.Secp256K1)
|
||||
|
||||
res := make(secp256k1.PubKey, secp256k1.PubKeySize)
|
||||
copy(res, key.Secp256K1)
|
||||
return res, nil
|
||||
case *types.PublicKey_Ed25519:
|
||||
n := len(key.Ed25519)
|
||||
if n != ed255192.PubKeyEd25519Size {
|
||||
if n != ed255192.PubKeySize {
|
||||
return nil, fmt.Errorf("wrong length %d for ed25519 public key", n)
|
||||
}
|
||||
var res ed255192.PubKeyEd25519
|
||||
copy(res[:], key.Ed25519)
|
||||
|
||||
res := make(ed255192.PubKey, ed255192.PubKeySize)
|
||||
copy(res, key.Ed25519)
|
||||
return res, nil
|
||||
case *types.PublicKey_Sr25519:
|
||||
n := len(key.Sr25519)
|
||||
if n != sr25519.PubKeySr25519Size {
|
||||
if n != sr25519.PubKeySize {
|
||||
return nil, fmt.Errorf("wrong length %d for sr25519 public key", n)
|
||||
}
|
||||
var res sr25519.PubKeySr25519
|
||||
copy(res[:], key.Sr25519)
|
||||
|
||||
res := make(sr25519.PubKey, sr25519.PubKeySize)
|
||||
copy(res, key.Sr25519)
|
||||
|
||||
return res, nil
|
||||
case *types.PublicKey_Multisig:
|
||||
@@ -66,12 +69,12 @@ func (cdc DefaultPublicKeyCodec) Decode(key *types.PublicKey) (crypto.PubKey, er
|
||||
// Encode implements the PublicKeyCodec.Encode method
|
||||
func (cdc DefaultPublicKeyCodec) Encode(key crypto.PubKey) (*types.PublicKey, error) {
|
||||
switch key := key.(type) {
|
||||
case secp256k1.PubKeySecp256k1:
|
||||
return &types.PublicKey{Sum: &types.PublicKey_Secp256K1{Secp256K1: key[:]}}, nil
|
||||
case ed255192.PubKeyEd25519:
|
||||
return &types.PublicKey{Sum: &types.PublicKey_Ed25519{Ed25519: key[:]}}, nil
|
||||
case sr25519.PubKeySr25519:
|
||||
return &types.PublicKey{Sum: &types.PublicKey_Sr25519{Sr25519: key[:]}}, nil
|
||||
case secp256k1.PubKey:
|
||||
return &types.PublicKey{Sum: &types.PublicKey_Secp256K1{Secp256K1: key}}, nil
|
||||
case ed255192.PubKey:
|
||||
return &types.PublicKey{Sum: &types.PublicKey_Ed25519{Ed25519: key}}, nil
|
||||
case sr25519.PubKey:
|
||||
return &types.PublicKey{Sum: &types.PublicKey_Sr25519{Sr25519: key}}, nil
|
||||
case multisig.PubKeyMultisigThreshold:
|
||||
pubKeys := key.PubKeys
|
||||
resKeys := make([]*types.PublicKey, len(pubKeys))
|
||||
|
||||
Reference in New Issue
Block a user