-
Notifications
You must be signed in to change notification settings - Fork 0
/
codec.go
33 lines (28 loc) · 1.04 KB
/
codec.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package multisig
import (
"github.com/soominhyunwoo/tendermint/crypto/sr25519"
"github.com/soominhyunwoo/chain-sdk/codec"
"github.com/soominhyunwoo/chain-sdk/crypto/keys/ed25519"
"github.com/soominhyunwoo/chain-sdk/crypto/keys/secp256k1"
cryptotypes "github.com/soominhyunwoo/chain-sdk/crypto/types"
)
// TODO: Figure out API for others to either add their own pubkey types, or
// to make verify / marshal accept a AminoCdc.
const (
PubKeyAminoRoute = "tendermint/PubKeyMultisigThreshold"
)
//nolint
// Deprecated: Amino is being deprecated in the SDK. But even if you need to
// use Amino for some reason, please use `codec/legacy.Cdc` instead.
var AminoCdc = codec.NewLegacyAmino()
func init() {
AminoCdc.RegisterInterface((*cryptotypes.PubKey)(nil), nil)
AminoCdc.RegisterConcrete(ed25519.PubKey{},
ed25519.PubKeyName, nil)
AminoCdc.RegisterConcrete(sr25519.PubKey{},
sr25519.PubKeyName, nil)
AminoCdc.RegisterConcrete(&secp256k1.PubKey{},
secp256k1.PubKeyName, nil)
AminoCdc.RegisterConcrete(&LegacyAminoPubKey{},
PubKeyAminoRoute, nil)
}