codec

package
v0.52.0-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 14 Imported by: 4,080

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromCmtProtoPublicKey added in v0.50.0

func FromCmtProtoPublicKey(protoPk cmtprotocrypto.PublicKey) (cryptotypes.PubKey, error)

FromCmtProtoPublicKey converts a CMT's cmtprotocrypto.PublicKey into our own PubKey.

func FromCmtPubKeyInterface added in v0.50.0

func FromCmtPubKeyInterface(tmPk cmtcrypto.PubKey) (cryptotypes.PubKey, error)

FromCmtPubKeyInterface converts CMT's cmtcrypto.PubKey to our own PubKey.

func PubKeyFromProto

func PubKeyFromProto(pk cryptotypes.PubKey) (cryptokeys.JSONPubkey, error)

PubKeyFromProto converts a protobuf public key (in `cryptotypes.PubKey` format) to a JSON public key format (`cryptokeys.JSONPubkey`).

Parameters: - pk: A `cryptotypes.PubKey` which is the protobuf representation of a public key.

Returns: - cryptokeys.JSONPubkey: The JSON-formatted public key corresponding to the provided protobuf public key. - error: An error if the key type is invalid or unsupported.

func PubKeyToProto

func PubKeyToProto(pk cryptokeys.JSONPubkey) (cryptotypes.PubKey, error)

PubKeyToProto converts a JSON public key (in `cryptokeys.JSONPubkey` format) to its corresponding protobuf public key type.

Parameters: - pk: A `cryptokeys.JSONPubkey` containing the public key and its type.

Returns: - cryptotypes.PubKey: The protobuf public key corresponding to the provided JSON public key. - error: An error if the key type is invalid or unsupported.

func RegisterCrypto

func RegisterCrypto(registrar registry.AminoRegistrar)

RegisterCrypto registers all crypto dependency types with the provided Amino codec.

func RegisterInterfaces

func RegisterInterfaces(registry registry.InterfaceRegistrar)

RegisterInterfaces registers the sdk.Tx interface.

func ToCmtProtoPublicKey added in v0.50.0

func ToCmtProtoPublicKey(pk cryptotypes.PubKey) (cmtprotocrypto.PublicKey, error)

ToCmtProtoPublicKey converts our own PubKey to Cmt's cmtprotocrypto.PublicKey.

func ToCmtPubKeyInterface added in v0.50.0

func ToCmtPubKeyInterface(pk cryptotypes.PubKey) (cmtcrypto.PubKey, error)

ToCmtPubKeyInterface converts our own PubKey to CMT's cmtcrypto.PubKey.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL