* Move codec.Cdc to legacy_global.Cdc * Update CHANGELOG.md * Updates * nit * Fix imports * Updates * Use cosmos multisig instead of tendermint multisig everywhere * Fix tests * Rename legacy_global -> legacy * Add doc.go * Linting, move all RegisterCrypto calls to crypto/codec * Update crypto/codec/amino.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
26 lines
510 B
Go
26 lines
510 B
Go
package keys
|
|
|
|
import (
|
|
"github.com/cosmos/cosmos-sdk/codec"
|
|
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
|
|
)
|
|
|
|
// KeysCdc defines codec to be used with key operations
|
|
var KeysCdc *codec.Codec
|
|
|
|
func init() {
|
|
KeysCdc = codec.New()
|
|
cryptocodec.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)
|
|
}
|