-
Notifications
You must be signed in to change notification settings - Fork 0
/
amino.go
28 lines (23 loc) · 840 Bytes
/
amino.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
package codec
import (
"github.com/cosmos/cosmos-sdk/client/keys"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/legacy"
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
"github.com/Pirrozho4ek/ethermint/crypto/ethsecp256k1"
)
// RegisterCrypto registers all crypto dependency types with the provided Amino
// codec.
func RegisterCrypto(cdc *codec.LegacyAmino) {
cdc.RegisterConcrete(ðsecp256k1.PubKey{},
ethsecp256k1.PubKeyName, nil)
cdc.RegisterConcrete(ðsecp256k1.PrivKey{},
ethsecp256k1.PrivKeyName, nil)
keyring.RegisterLegacyAminoCodec(cdc)
cryptocodec.RegisterCrypto(cdc)
// NOTE: update SDK's amino codec to include the ethsecp256k1 keys.
// DO NOT REMOVE unless deprecated on the SDK.
legacy.Cdc = cdc
keys.KeysCdc = cdc
}