cosmos-sdk/client/keys/codec.go
Austin Abell 0e28da23e7 Interchangable PrivKey implementations in keybase (#5278)
Allow for the keybase to be configured to override the implementation
of the key that is saved to the keybase.

Closes: #4941
2019-12-12 21:52:24 +00:00

25 lines
447 B
Go

package keys
import (
"github.com/cosmos/cosmos-sdk/codec"
)
// KeysCdc defines codec to be used with key operations
var KeysCdc *codec.Codec
func init() {
KeysCdc = codec.New()
codec.RegisterCrypto(KeysCdc)
KeysCdc.Seal()
}
// marshal keys
func MarshalJSON(o interface{}) ([]byte, error) {
return KeysCdc.MarshalJSON(o)
}
// unmarshal json
func UnmarshalJSON(bz []byte, ptr interface{}) error {
return KeysCdc.UnmarshalJSON(bz, ptr)
}