Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: Kerying migration #9222

Closed
wants to merge 133 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
c727fa6
Keyring migration from amino to proto
robert-zaremba Apr 16, 2021
7505e5a
adding proto definitions - wip
robert-zaremba Apr 16, 2021
9160257
add rename in the test
robert-zaremba Apr 16, 2021
16eebea
define proto structs for all structs in keyring/info.go
cyberbono3 Apr 22, 2021
6ae658d
generate types.pb.go
cyberbono3 Apr 26, 2021
bcd9f81
WIP keyring migration
cyberbono3 Apr 28, 2021
36311a3
new proto model,gen types.pb.go and define protoMarshalKeyringEntry,p…
cyberbono3 Apr 29, 2021
c9ae124
KeyringEntry satisfies Info interface
cyberbono3 Apr 29, 2021
2421d02
fix KeyringEntry getters
cyberbono3 Apr 30, 2021
ea31d04
WIP add codec to keystore and dbKeybase, fix protoMarshal,protoUnmars…
cyberbono3 Apr 30, 2021
23a2316
apply some of reviewers changes
cyberbono3 May 4, 2021
1f0ae05
fix protos
cyberbono3 May 4, 2021
059aa39
fix keyring.New
cyberbono3 May 4, 2021
3a420d2
pass *codec.AminoCodec as function argument in keyring.New
cyberbono3 May 4, 2021
52426d4
replace codec.AmintoCodec by codec.Codec
cyberbono3 May 4, 2021
9a4bd80
merge master to kerying-migration
cyberbono3 May 4, 2021
51afe76
add codec.Codec as argument in keyring.New, NewInMemory in keyring pa…
cyberbono3 May 4, 2021
6edb399
WIP cycle dep issue
cyberbono3 May 10, 2021
c99594a
WIP fixed dep cycle but tests still fail
cyberbono3 May 11, 2021
0aca25f
WIP add PubKeyType to crypto/types.proto
cyberbono3 May 11, 2021
e9e0b4f
add pubKeyType to types.proto, fixing tests in progress
cyberbono3 May 12, 2021
9a61180
WIP fixing keyring_test.go tests
cyberbono3 May 12, 2021
cb8c94f
fix all tests keytirng_test.go except encCfg.Marshaler
cyberbono3 May 13, 2021
2bc9cfc
fixed almost all tests in keyring_test.go
cyberbono3 May 13, 2021
83c290a
WIP writeLedgerKey
cyberbono3 May 14, 2021
5a5a9c6
reviewed keyring.go
cyberbono3 May 15, 2021
fba942d
review legacy.go
cyberbono3 May 15, 2021
2059243
review legacy_test.go
cyberbono3 May 15, 2021
860e0d0
WIP remove Info from keyring package entirely
cyberbono3 May 19, 2021
f9b32f0
WIP set record.go
cyberbono3 May 22, 2021
f18de4c
remove dep cycle
cyberbono3 May 23, 2021
ebc6d44
add legacyinfo.go
cyberbono3 May 25, 2021
e465ac6
fix writeLocalKey in keyring.go
cyberbono3 May 25, 2021
26d4672
WIP fix tests
cyberbono3 May 25, 2021
990cee7
remove gogoproto.goproto_stringer=false by structs in protos and fix …
cyberbono3 May 25, 2021
3f00b76
make Codec field on clientCtx struct
cyberbono3 May 25, 2021
79ebb56
set re variable name in GetFromFields in context.go
cyberbono3 May 27, 2021
ab4480f
do not modify the second argument in cdc.RegisterConcrete
cyberbono3 May 27, 2021
c9f6911
rename SavePubKey to SaveOfflineKey
cyberbono3 May 27, 2021
0778fdf
fix some tests in keyring_test.go
cyberbono3 May 27, 2021
cab7c66
generate hd.pb.go inside crypto/hd
cyberbono3 May 27, 2021
35aea35
fix BIP44Params in record.go
cyberbono3 May 27, 2021
7365334
try to fix makeMultiSignCmd()
cyberbono3 May 28, 2021
5865d9d
fix makeMultiSignCmd
cyberbono3 May 28, 2021
d5c3c88
fix client/tx/tx.go and x/auth/client/tx.go
cyberbono3 May 29, 2021
a56cf27
fix x/auth/client/cli/tx_multisign.go
cyberbono3 May 29, 2021
6440a36
WIP fix Unable to cast PubKey to cryptotypes.PubKey error
cyberbono3 May 31, 2021
fe26c52
fix TestNewKeyring test
cyberbono3 Jun 2, 2021
f5d5e6b
fix all tests except tests require migration fix
cyberbono3 Jun 2, 2021
3dc26a5
migration questions
cyberbono3 Jun 2, 2021
6fd3fed
fix migrate func and implement convertFromLegacyInfo
cyberbono3 Jun 7, 2021
c684f59
WIP debugging TestSignVerifyKeyRing
cyberbono3 Jun 7, 2021
372cc34
update migration algorithm
cyberbono3 Jun 9, 2021
6ed3edd
set proper naming k for Record
cyberbono3 Jun 10, 2021
1b16f94
some cosmetic stuff
cyberbono3 Jun 10, 2021
d362139
implement protoUnmarshalRecord
cyberbono3 Jun 10, 2021
68816b7
minor fixes
cyberbono3 Jun 10, 2021
3df8c9b
gen new protos according to robert suggestion
cyberbono3 Jun 10, 2021
5bf2889
fix new methods for local,ledger,empty items
cyberbono3 Jun 10, 2021
36764e3
latest version
cyberbono3 Jun 11, 2021
e3fe793
minor fixes
cyberbono3 Jun 14, 2021
17b45ae
modify VERSION_KEY to 1(string repr)
cyberbono3 Jun 14, 2021
241feb6
trying to fix an error - unable to unpack private key
cyberbono3 Jun 15, 2021
7815f41
any unpack does not work in protoUnmarshalRecord
cyberbono3 Jun 16, 2021
c538c57
minor fixes in record.go
cyberbono3 Jun 16, 2021
0a92755
keyring record marshaling tests
robert-zaremba Jun 17, 2021
9f5678d
TestRecordMarshaling pass
cyberbono3 Jun 17, 2021
23b33b2
TestLocalRecordMarshaling pass
cyberbono3 Jun 18, 2021
520cc56
TODO fix TestExtractPrivKeyFromItem test
cyberbono3 Jun 18, 2021
7a4b74e
TODO fix TestMigrationOneLegacyKey too many failed passphrase attempts
cyberbono3 Jun 18, 2021
d717da0
TestMigrationOneLegacyLocalKey and TestMigrationRecord pass
cyberbono3 Jun 21, 2021
7cd88cb
WIP finishing migration tests
cyberbono3 Jun 21, 2021
45fdfcb
all migration tests pass except TestMigrationLegacyLedgerKey
cyberbono3 Jun 21, 2021
f74cf65
debugging TestExtractPrivKeyFromItem
cyberbono3 Jun 21, 2021
fe68c74
all record tests pass
cyberbono3 Jun 22, 2021
e690fde
fix all tests in migration_test.go
cyberbono3 Jun 22, 2021
f9965e7
remove LegacyInfoWriter interface from legacy_info.go
cyberbono3 Jun 22, 2021
4c48fea
update checkMigrate and migrate funcs
cyberbono3 Jun 22, 2021
8109936
update migration algo and fix migration tests
cyberbono3 Jun 23, 2021
303e7fe
update Migrate,MigrateAll and fix migration tests
cyberbono3 Jun 24, 2021
9d87490
remove VERSION_KEY, add some migration tests
cyberbono3 Jun 28, 2021
dbd041c
fix errors clients/keys package
cyberbono3 Jun 29, 2021
0c751ed
fix migrate logic and migrateCmd tests
cyberbono3 Jun 29, 2021
fe39205
WIP debugging TestKeyManagementKeyRing
cyberbono3 Jun 29, 2021
35dbe9c
fix TestKeyManagementKeyRing test
cyberbono3 Jun 30, 2021
f5af15c
fix MigrateAll and adjust migrations tests
cyberbono3 Jun 30, 2021
f0988b1
fix TestSignVerifyKeyRing
cyberbono3 Jun 30, 2021
381dc27
fix TestExportImportKeyRing
cyberbono3 Jun 30, 2021
89764ba
fix TestSeedPhraseKeyRing test
cyberbono3 Jun 30, 2021
b232cea
fix TestKeyringKeybaseExportImportPrivKey
cyberbono3 Jun 30, 2021
599b413
WIP fixing keyring tests
cyberbono3 Jun 30, 2021
8dcefee
fix all keyring tests except ExampleNew
cyberbono3 Jul 1, 2021
a8856d3
fix TestProtoMarshalJSON
cyberbono3 Jul 1, 2021
4468f7d
fix TestArmorUnarmorPubKey
cyberbono3 Jul 1, 2021
4235a58
fix TestSign
cyberbono3 Jul 1, 2021
1214b2e
WIP debugging client/keys tests
cyberbono3 Jul 1, 2021
0ebbfaf
fix server/init tests
cyberbono3 Jul 1, 2021
654e34e
Test_runAddCmdBasic panic
cyberbono3 Jul 1, 2021
d1bccca
WIP fixing tests
cyberbono3 Jul 2, 2021
e0b0073
cdc is nil
cyberbono3 Jul 6, 2021
4735d9f
fix x/auth/tx/service_test.go test
cyberbono3 Jul 6, 2021
c728543
WIP debugging Test_runAddCmdBasic
cyberbono3 Jul 6, 2021
41b0d03
fix Test_runAddCmdBasic
cyberbono3 Jul 6, 2021
4d88638
fix Test_runDeleteCmd
cyberbono3 Jul 6, 2021
e0e4915
fix all tests in client/keys except export_test
cyberbono3 Jul 7, 2021
78d81be
fix rest tests
cyberbono3 Jul 7, 2021
42a5c62
fix grps_query_test
cyberbono3 Jul 7, 2021
d272991
cleanup
cyberbono3 Jul 7, 2021
c03be48
WIP fix no registered implementations of type types.PrivKey
cyberbono3 Jul 7, 2021
c736b8f
merge master to current branch and resolve conflicts
cyberbono3 Jul 7, 2021
fcf1b70
remove legacy and legacy_test entirely
cyberbono3 Jul 7, 2021
baaeda0
WIP fix extractPrivKeyFromLocal Unable to cast any to cryptotypes.Pr…
cyberbono3 Jul 8, 2021
39cd82c
fix TestSignVerifyKeyRing and cast any to PrivKey issue
cyberbono3 Jul 8, 2021
b6cb87f
WIP fix all keyring tests
cyberbono3 Jul 9, 2021
4c45144
fix all keyring_test package tests
cyberbono3 Jul 9, 2021
5ff7551
fix all client/keys package tests
cyberbono3 Jul 9, 2021
f209635
WIP fix tests
cyberbono3 Jul 9, 2021
faf232e
run make format
cyberbono3 Jul 9, 2021
30d7f3c
WIP fix tests and debug Test_runAddCmdLedgerDryRun
cyberbono3 Jul 11, 2021
f1e2084
fix all tests except TestIntegrationTestSuite
cyberbono3 Jul 12, 2021
3117ce9
fix all tests
cyberbono3 Jul 12, 2021
4882db8
minor fixes
cyberbono3 Jul 12, 2021
c691246
Merge branch 'master' into kerying-migration
cyberbono3 Jul 13, 2021
5514769
remove dead code
cyberbono3 Jul 13, 2021
b0685fe
gofmt
cyberbono3 Jul 13, 2021
4d8c0e8
refactor keyring_test.go
cyberbono3 Jul 13, 2021
24f44e8
add TestMigrateErrEmptyItemData to migration_test.go
cyberbono3 Jul 13, 2021
fe572c9
set proper codec in genaccounts.go
cyberbono3 Jul 13, 2021
dda1851
set proper codec in testnet.go
cyberbono3 Jul 13, 2021
8f239df
remove some comments from x/authz/client/testutil/tx.go
cyberbono3 Jul 13, 2021
1401291
fix lint comments
cyberbono3 Jul 13, 2021
7beebb2
fix ineffectual assignment to err in 2 suite files
cyberbono3 Jul 13, 2021
8652e00
update proto files
cyberbono3 Jul 13, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions crypto/keyring/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ func init() {
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
cdc.RegisterInterface((*Info)(nil), nil)
cdc.RegisterConcrete(hd.BIP44Params{}, "crypto/keys/hd/BIP44Params", nil)
cdc.RegisterConcrete(localInfo{}, "crypto/keys/localInfo", nil)
cdc.RegisterConcrete(ledgerInfo{}, "crypto/keys/ledgerInfo", nil)
cdc.RegisterConcrete(offlineInfo{}, "crypto/keys/offlineInfo", nil)
cdc.RegisterConcrete(multiInfo{}, "crypto/keys/multiInfo", nil)
cdc.RegisterConcrete(LocalInfo{}, "crypto/keys/LocalInfo", nil)
cdc.RegisterConcrete(LedgerInfo{}, "crypto/keys/LedgerInfo", nil)
cdc.RegisterConcrete(OfflineInfo{}, "crypto/keys/OfflineInfo", nil)
cdc.RegisterConcrete(MultiInfo{}, "crypto/keys/MultiInfo", nil)
}
221 changes: 59 additions & 162 deletions crypto/keyring/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,288 +3,185 @@ package keyring
import (
"fmt"

"github.com/cosmos/cosmos-sdk/codec/legacy"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/crypto/hd"
"github.com/cosmos/cosmos-sdk/crypto/keys/multisig"
crypto_ed25519 "crypto/ed25519"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
"github.com/cosmos/cosmos-sdk/types"

sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/gogo/protobuf/proto"
)

// Info is the publicly exposed information about a keypair

// TODO fix GetPath and GetAlgo in whole codebase
type Info interface {
// Human-readable type for key listing
GetType() KeyType
// Name of the key
GetName() string
// Public key
GetPubKey() cryptotypes.PubKey
GetPubKey() crypto_ed25519.PublicKey
// Address
GetAddress() types.AccAddress
// Bip44 Path
GetPath() (*hd.BIP44Params, error)
GetPath() (*BIP44Params, error)
// Algo
GetAlgo() hd.PubKeyType
GetAlgo() PubKeyType
}

var (
_ Info = &localInfo{}
_ Info = &ledgerInfo{}
_ Info = &offlineInfo{}
_ Info = &multiInfo{}
_ Info = &LocalInfo{}
_ Info = &LedgerInfo{}
_ Info = &OfflineInfo{}
_ Info = &MultiInfo{}
)

// localInfo is the public information about a locally stored key
// Note: Algo must be last field in struct for backwards amino compatibility
type localInfo struct {
Name string `json:"name"`
PubKey cryptotypes.PubKey `json:"pubkey"`
PrivKeyArmor string `json:"privkey.armor"`
Algo hd.PubKeyType `json:"algo"`
}
// TODO fix errors, GetAddress and GetAlgo

func newLocalInfo(name string, pub cryptotypes.PubKey, privArmor string, algo hd.PubKeyType) Info {
return &localInfo{
Name: name,
PubKey: pub,
PrivKeyArmor: privArmor,
Algo: algo,
}
}
//LocalInfo

// GetType implements Info interface
func (i localInfo) String() KeyType {
func (i LocalInfo) String() KeyType {
return fmt.Sprintf("LocalInfo{%s}", i.Name)
}

// GetType implements Info interface
func (i localInfo) GetType() KeyType {
func (i LocalInfo) GetType() KeyType {
// review Type
return TypeLocal
}

// GetType implements Info interface
func (i localInfo) GetName() string {
func (i LocalInfo) GetName() string {
return i.Name
}

// GetType implements Info interface
func (i localInfo) GetPubKey() cryptotypes.PubKey {
return i.PubKey
func (i LocalInfo) GetPubKey() crypto_ed25519.PublicKey {
return i.Key
}

// GetType implements Info interface
func (i localInfo) GetAddress() types.AccAddress {
return i.PubKey.Address().Bytes()
func (i LocalInfo) GetAddress() types.AccAddress {
return i.Key.Address().Bytes()
}

// GetType implements Info interface
func (i localInfo) GetAlgo() hd.PubKeyType {
func (i LocalInfo) GetAlgo() PubKeyType {
return i.Algo
}

// GetType implements Info interface
func (i localInfo) GetPath() (*hd.BIP44Params, error) {
func (i LocalInfo) GetPath() (*BIP44Params, error) {
return nil, fmt.Errorf("BIP44 Paths are not available for this type")
}

// ledgerInfo is the public information about a Ledger key
// Note: Algo must be last field in struct for backwards amino compatibility
type ledgerInfo struct {
Name string `json:"name"`
PubKey cryptotypes.PubKey `json:"pubkey"`
Path hd.BIP44Params `json:"path"`
Algo hd.PubKeyType `json:"algo"`
}
// LEDGERINFO

func newLedgerInfo(name string, pub cryptotypes.PubKey, path hd.BIP44Params, algo hd.PubKeyType) Info {
return &ledgerInfo{
Name: name,
PubKey: pub,
Path: path,
Algo: algo,
}
}

// GetType implements Info interface
func (i ledgerInfo) GetType() KeyType {
func (i LedgerInfo) GetType() KeyType {
return TypeLedger
}

// GetName implements Info interface
func (i ledgerInfo) GetName() string {
func (i LedgerInfo) GetName() string {
return i.Name
}

// GetPubKey implements Info interface
func (i ledgerInfo) GetPubKey() cryptotypes.PubKey {
return i.PubKey
func (i LedgerInfo) GetPubKey() crypto_ed25519.PublicKey {
return i.Key
}

// GetAddress implements Info interface
func (i ledgerInfo) GetAddress() types.AccAddress {
return i.PubKey.Address().Bytes()
func (i LedgerInfo) GetAddress() types.AccAddress {
return i.Key.Address().Bytes()
}

// GetPath implements Info interface
func (i ledgerInfo) GetAlgo() hd.PubKeyType {
func (i LedgerInfo) GetAlgo() PubKeyType {
return i.Algo
}

// GetPath implements Info interface
func (i ledgerInfo) GetPath() (*hd.BIP44Params, error) {
func (i LedgerInfo) GetPath() (*BIP44Params, error) {
tmp := i.Path
return &tmp, nil
}

// offlineInfo is the public information about an offline key
// Note: Algo must be last field in struct for backwards amino compatibility
type offlineInfo struct {
Name string `json:"name"`
PubKey cryptotypes.PubKey `json:"pubkey"`
Algo hd.PubKeyType `json:"algo"`
}

func newOfflineInfo(name string, pub cryptotypes.PubKey, algo hd.PubKeyType) Info {
return &offlineInfo{
Name: name,
PubKey: pub,
Algo: algo,
}
}
// OFFLINEINFO

// GetType implements Info interface
func (i offlineInfo) GetType() KeyType {
func (i OfflineInfo) GetType() KeyType {
return TypeOffline
}

// GetName implements Info interface
func (i offlineInfo) GetName() string {
func (i OfflineInfo) GetName() string {
return i.Name
}

// GetPubKey implements Info interface
func (i offlineInfo) GetPubKey() cryptotypes.PubKey {
return i.PubKey
func (i OfflineInfo) GetPubKey() crypto_ed25519.PublicKey {
return i.Key
}

// GetAlgo returns the signing algorithm for the key
func (i offlineInfo) GetAlgo() hd.PubKeyType {
func (i OfflineInfo) GetAlgo() PubKeyType {
return i.Algo
}

// GetAddress implements Info interface
func (i offlineInfo) GetAddress() types.AccAddress {
return i.PubKey.Address().Bytes()
func (i OfflineInfo) GetAddress() types.AccAddress {
return i.Key.Address().Bytes()
}

// GetPath implements Info interface
func (i offlineInfo) GetPath() (*hd.BIP44Params, error) {
func (i OfflineInfo) GetPath() (*BIP44Params, error) {
return nil, fmt.Errorf("BIP44 Paths are not available for this type")
}

// Deprecated: this structure is not used anymore and it's here only to allow
// decoding old multiInfo records from keyring.
// The problem with legacy.Cdc.UnmarshalBinaryLengthPrefixed - the legacy codec doesn't
// tolerate extensibility.
type multisigPubKeyInfo struct {
PubKey cryptotypes.PubKey `json:"pubkey"`
Weight uint `json:"weight"`
}

// multiInfo is the public information about a multisig key
type multiInfo struct {
Name string `json:"name"`
PubKey cryptotypes.PubKey `json:"pubkey"`
Threshold uint `json:"threshold"`
PubKeys []multisigPubKeyInfo `json:"pubkeys"`
}

// NewMultiInfo creates a new multiInfo instance
func NewMultiInfo(name string, pub cryptotypes.PubKey) (Info, error) {
if _, ok := pub.(*multisig.LegacyAminoPubKey); !ok {
return nil, fmt.Errorf("MultiInfo supports only multisig.LegacyAminoPubKey, got %T", pub)
}
return &multiInfo{
Name: name,
PubKey: pub,
}, nil
}
// MULTIINFO

// GetType implements Info interface
func (i multiInfo) GetType() KeyType {
func (i MultiInfo) GetType() KeyType {
return TypeMulti
}

// GetName implements Info interface
func (i multiInfo) GetName() string {
func (i MultiInfo) GetName() string {
return i.Name
}

// GetPubKey implements Info interface
func (i multiInfo) GetPubKey() cryptotypes.PubKey {
return i.PubKey
func (i MultiInfo) GetPubKey() crypto_ed25519.PublicKey {
return i.Key
}

// GetAddress implements Info interface
func (i multiInfo) GetAddress() types.AccAddress {
return i.PubKey.Address().Bytes()
func (i MultiInfo) GetAddress() types.AccAddress {
return i.Key.Address().Bytes()
}

// GetPath implements Info interface
func (i multiInfo) GetAlgo() hd.PubKeyType {
return hd.MultiType
func (i MultiInfo) GetAlgo() PubKeyType {
return PubKeyType_MultiType
}

// GetPath implements Info interface
func (i multiInfo) GetPath() (*hd.BIP44Params, error) {
func (i MultiInfo) GetPath() (*BIP44Params, error) {
return nil, fmt.Errorf("BIP44 Paths are not available for this type")
}

// UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces
func (i multiInfo) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error {
multiPK := i.PubKey.(*multisig.LegacyAminoPubKey)

return codectypes.UnpackInterfaces(multiPK, unpacker)
}

// encoding info
// TODO: remove
func aminoMarshalInfo(i Info) []byte {
return legacy.Cdc.MustMarshalBinaryLengthPrefixed(i)
func protoMarshalInfo(i Info) []byte {
bz, _ := proto.Marshal(i.(proto.Message))
return bz
}

// decoding info
func aminoUnmarshalInfo(bz []byte) (info Info, err error) {
err = legacy.Cdc.UnmarshalBinaryLengthPrefixed(bz, &info)
if err != nil {
return nil, err
}

// After unmarshalling into &info, if we notice that the info is a
// multiInfo, then we unmarshal again, explicitly in a multiInfo this time.
// Since multiInfo implements UnpackInterfacesMessage, this will correctly
// unpack the underlying anys inside the multiInfo.
//
// This is a workaround, as go cannot check that an interface (Info)
// implements another interface (UnpackInterfacesMessage).
_, ok := info.(multiInfo)
if ok {
var multi multiInfo
err = legacy.Cdc.UnmarshalBinaryLengthPrefixed(bz, &multi)

return multi, err
func protoUnmarshalInfo(bz []byte) (info Info, err error) {
if err := proto.Unmarshal(bz, info.(proto.Message)); err != nil {
return nil, sdkerrors.Wrap(err, "failed to unmarshal bytes to Info")
}

return
}

// encoding info
func protoMarshalInfo(i Info) []byte {
// TODO
// Convert pub key to a proto keyring.Item structure Item.Data
}

// decoding info
func protoUnmarshalInfo(bz []byte) (item Info, err error) {
// TODO
}
Loading