types

package
v3.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// ExpectedChainID defines the chain id an off-chain message must have
	ExpectedChainID = ""
	// ExpectedAccountNumber defines the account number an off-chain message must have
	ExpectedAccountNumber = 0
	// ExpectedSequence defines the sequence number an off-chain message must have
	ExpectedSequence = 0
	// ExpectedRoute defines the route to use for sdk.Msg.ExpectedRoute() implementation for offchain messages
	ExpectedRoute = "offchain"
)

Variables

View Source
var (
	ErrInvalidLengthOffchain        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowOffchain          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupOffchain = fmt.Errorf("proto: unexpected end of group")
)
View Source
var ModuleCdc = codec.NewAminoCodec(amino)

ModuleCdc is the codec used by the module to serialize and deserialize data

Functions

func RegisterInterfaces

func RegisterInterfaces(ir types.InterfaceRegistry)

RegisterInterfaces adds offchain sdk.Msg types to the interface registry

func RegisterLegacyAminoCodec

func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

RegisterLegacyAminoCodec registers amino's legacy codec

Types

type ListOfMsgSignData

type ListOfMsgSignData struct {
	// msgs is a list of messages
	Msgs []*MsgSignData `protobuf:"bytes,1,rep,name=msgs,proto3" json:"msgs,omitempty"`
}

ListOfMsgSignData defines a list of MsgSignData, used to marshal and unmarshal them in a clean way

func (*ListOfMsgSignData) Descriptor

func (*ListOfMsgSignData) Descriptor() ([]byte, []int)

func (*ListOfMsgSignData) GetMsgs

func (m *ListOfMsgSignData) GetMsgs() []*MsgSignData

func (*ListOfMsgSignData) Marshal

func (m *ListOfMsgSignData) Marshal() (dAtA []byte, err error)

func (*ListOfMsgSignData) MarshalTo

func (m *ListOfMsgSignData) MarshalTo(dAtA []byte) (int, error)

func (*ListOfMsgSignData) MarshalToSizedBuffer

func (m *ListOfMsgSignData) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ListOfMsgSignData) ProtoMessage

func (*ListOfMsgSignData) ProtoMessage()

func (*ListOfMsgSignData) Reset

func (m *ListOfMsgSignData) Reset()

func (*ListOfMsgSignData) Size

func (m *ListOfMsgSignData) Size() (n int)

func (*ListOfMsgSignData) String

func (m *ListOfMsgSignData) String() string

func (*ListOfMsgSignData) Unmarshal

func (m *ListOfMsgSignData) Unmarshal(dAtA []byte) error

func (*ListOfMsgSignData) XXX_DiscardUnknown

func (m *ListOfMsgSignData) XXX_DiscardUnknown()

func (*ListOfMsgSignData) XXX_Marshal

func (m *ListOfMsgSignData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ListOfMsgSignData) XXX_Merge

func (m *ListOfMsgSignData) XXX_Merge(src proto.Message)

func (*ListOfMsgSignData) XXX_Size

func (m *ListOfMsgSignData) XXX_Size() int

func (*ListOfMsgSignData) XXX_Unmarshal

func (m *ListOfMsgSignData) XXX_Unmarshal(b []byte) error

type MsgSignData

type MsgSignData struct {
	// signer is the bech32 representation of the signer's account address
	Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"`
	// data represents the raw bytes of the content that is signed (text, json, etc)
	Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
}

MsgSignData defines an arbitrary, general-purpose, off-chain message

func NewMsgSignData

func NewMsgSignData(signer sdk.AccAddress, data []byte) *MsgSignData

NewMsgSignData is MsgSignData's constructor

func (*MsgSignData) Descriptor

func (*MsgSignData) Descriptor() ([]byte, []int)

func (*MsgSignData) GetData

func (m *MsgSignData) GetData() []byte

func (*MsgSignData) GetSignBytes

func (m *MsgSignData) GetSignBytes() []byte

func (*MsgSignData) GetSigner

func (m *MsgSignData) GetSigner() string

func (*MsgSignData) GetSigners

func (m *MsgSignData) GetSigners() []sdk.AccAddress

func (*MsgSignData) Marshal

func (m *MsgSignData) Marshal() (dAtA []byte, err error)

func (*MsgSignData) MarshalTo

func (m *MsgSignData) MarshalTo(dAtA []byte) (int, error)

func (*MsgSignData) MarshalToSizedBuffer

func (m *MsgSignData) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgSignData) ProtoMessage

func (*MsgSignData) ProtoMessage()

func (*MsgSignData) Reset

func (m *MsgSignData) Reset()

func (*MsgSignData) Route

func (m *MsgSignData) Route() string

func (*MsgSignData) Size

func (m *MsgSignData) Size() (n int)

func (*MsgSignData) String

func (m *MsgSignData) String() string

func (*MsgSignData) Type

func (m *MsgSignData) Type() string

func (*MsgSignData) Unmarshal

func (m *MsgSignData) Unmarshal(dAtA []byte) error

func (*MsgSignData) ValidateBasic

func (m *MsgSignData) ValidateBasic() error

func (*MsgSignData) XXX_DiscardUnknown

func (m *MsgSignData) XXX_DiscardUnknown()

func (*MsgSignData) XXX_Marshal

func (m *MsgSignData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgSignData) XXX_Merge

func (m *MsgSignData) XXX_Merge(src proto.Message)

func (*MsgSignData) XXX_Size

func (m *MsgSignData) XXX_Size() int

func (*MsgSignData) XXX_Unmarshal

func (m *MsgSignData) XXX_Unmarshal(b []byte) error

type SignatureProvider

type SignatureProvider interface {
	Sign(msg []byte) (signedBytes []byte, err error)
	PubKey() cryptotypes.PubKey
}

SignatureProvider offers an abstraction over private keys which can be constructed from raw private keys or keyrings it is a subset of the methods exposed by cryptotypes.PrivKey

type SignatureVerifier

type SignatureVerifier struct {
	// contains filtered or unexported fields
}

SignatureVerifier takes care of verifying transactions given an instance of authsigning.SignModeHandler

func NewVerifier

func NewVerifier(signModeHandler authsigning.SignModeHandler) SignatureVerifier

NewVerifier is SignatureVerifier's constructor

func (SignatureVerifier) Verify

func (v SignatureVerifier) Verify(tx sdk.Tx) error

Verify takes an sdk.Tx and verifies it

type Signer

type Signer struct {
	// contains filtered or unexported fields
}

Signer defines an offchain messages signer

func NewSigner

func NewSigner(txConfig client.TxConfig, provider SignatureProvider) Signer

NewSigner is Signer's constructor

func NewSignerFromClientContext

func NewSignerFromClientContext(clientCtx client.Context) (Signer, error)

NewSignerFromClientContext builds an offchain message signer from a client context

func (Signer) Sign

func (s Signer) Sign(msgs []sdk.Msg) (authsigning.SigVerifiableTx, error)

Sign produces a signed tx given a private key and the msgs we're aiming to sign

Jump to

Keyboard shortcuts

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