types

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2023 License: Apache-2.0, Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthAbci        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowAbci          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupAbci = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	EventTypeTx = "tx"

	AttributeKeyAccountSequence = "acc_seq"
	AttributeKeySignature       = "signature"
	AttributeKeyFee             = "fee"

	EventTypeMessage = "message"

	AttributeKeyAction = "action"
	AttributeKeyModule = "module"
	AttributeKeySender = "sender"
	AttributeKeyAmount = "amount"
)

Common event types and attribute keys

Functions

func MarkEventsToIndex

func MarkEventsToIndex(events []abci.Event, indexSet map[string]struct{}) []abci.Event

MarkEventsToIndex returns the set of ABCI events, where each event's attribute has it's index value marked based on the provided set of events to index.

func MsgTypeURL

func MsgTypeURL(msg Msg) string

MsgTypeURL returns the TypeURL of a `sdk.Msg`.

func ParseTypedEvent

func ParseTypedEvent(event abci.Event) (proto.Message, error)

ParseTypedEvent converts abci.Event back to typed event

Types

type ABCIMessageLog

type ABCIMessageLog struct {
	MsgIndex uint32 `protobuf:"varint,1,opt,name=msg_index,json=msgIndex,proto3" json:"msg_index,omitempty"`
	Log      string `protobuf:"bytes,2,opt,name=log,proto3" json:"log,omitempty"`
	// Events contains a slice of Event objects that were emitted during some
	// execution.
	Events StringEvents `protobuf:"bytes,3,rep,name=events,proto3,castrepeated=StringEvents" json:"events"`
}

ABCIMessageLog defines a structure containing an indexed tx ABCI message log.

func NewABCIMessageLog

func NewABCIMessageLog(i uint32, log string, events Events) ABCIMessageLog

func (*ABCIMessageLog) Descriptor

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

func (*ABCIMessageLog) GetEvents

func (m *ABCIMessageLog) GetEvents() StringEvents

func (*ABCIMessageLog) GetLog

func (m *ABCIMessageLog) GetLog() string

func (*ABCIMessageLog) GetMsgIndex

func (m *ABCIMessageLog) GetMsgIndex() uint32

func (*ABCIMessageLog) Marshal

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

func (*ABCIMessageLog) MarshalTo

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

func (*ABCIMessageLog) MarshalToSizedBuffer

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

func (*ABCIMessageLog) ProtoMessage

func (*ABCIMessageLog) ProtoMessage()

func (*ABCIMessageLog) Reset

func (m *ABCIMessageLog) Reset()

func (*ABCIMessageLog) Size

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

func (*ABCIMessageLog) String

func (this *ABCIMessageLog) String() string

func (*ABCIMessageLog) Unmarshal

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

func (*ABCIMessageLog) XXX_DiscardUnknown

func (m *ABCIMessageLog) XXX_DiscardUnknown()

func (*ABCIMessageLog) XXX_Marshal

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

func (*ABCIMessageLog) XXX_Merge

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

func (*ABCIMessageLog) XXX_Size

func (m *ABCIMessageLog) XXX_Size() int

func (*ABCIMessageLog) XXX_Unmarshal

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

type ABCIMessageLogs

type ABCIMessageLogs []ABCIMessageLog

ABCIMessageLogs represents a slice of ABCIMessageLog.

func ParseABCILogs

func ParseABCILogs(logs string) (res ABCIMessageLogs, err error)

ParseABCILogs attempts to parse a stringified ABCI tx log into a slice of ABCIMessageLog types. It returns an error upon JSON decoding failure.

func (ABCIMessageLogs) String

func (logs ABCIMessageLogs) String() (str string)

String implements the fmt.Stringer interface for the ABCIMessageLogs type.

type Attribute

type Attribute struct {
	Key   string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
}

Attribute defines an attribute wrapper where the key and value are strings instead of raw bytes.

func NewAttribute

func NewAttribute(k, v string) Attribute

NewAttribute returns a new key/value Attribute object.

func (*Attribute) Descriptor

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

func (*Attribute) GetKey

func (m *Attribute) GetKey() string

func (*Attribute) GetValue

func (m *Attribute) GetValue() string

func (*Attribute) Marshal

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

func (*Attribute) MarshalTo

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

func (*Attribute) MarshalToSizedBuffer

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

func (*Attribute) ProtoMessage

func (*Attribute) ProtoMessage()

func (*Attribute) Reset

func (m *Attribute) Reset()

func (*Attribute) Size

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

func (Attribute) String

func (a Attribute) String() string

func (Attribute) ToKVPair

func (a Attribute) ToKVPair() kv.Pair

ToKVPair converts an Attribute object into a Tendermint key/value pair.

func (a Attribute) ToKVPair() abci.EventAttribute {
	return abci.EventAttribute{Key: toBytes(a.Key), Value: toBytes(a.Value)}
}

func (*Attribute) Unmarshal

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

func (*Attribute) XXX_DiscardUnknown

func (m *Attribute) XXX_DiscardUnknown()

func (*Attribute) XXX_Marshal

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

func (*Attribute) XXX_Merge

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

func (*Attribute) XXX_Size

func (m *Attribute) XXX_Size() int

func (*Attribute) XXX_Unmarshal

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

type Event

type Event abci.Event

Event is a type alias for an ABCI Event

func NewEvent

func NewEvent(ty string, attrs ...Attribute) Event

NewEvent creates a new Event object with a given type and slice of one or more attributes.

func TypedEventToEvent

func TypedEventToEvent(tev proto.Message) (Event, error)

TypedEventToEvent takes typed event and converts to Event object

func (Event) AppendAttributes

func (e Event) AppendAttributes(attrs ...Attribute) Event

AppendAttributes adds one or more attributes to an Event.

type EventManager

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

EventManager implements a simple wrapper around a slice of Event objects that can be emitted from.

func NewEventManager

func NewEventManager() *EventManager

func (EventManager) ABCIEvents

func (em EventManager) ABCIEvents() []abci.Event

ABCIEvents returns all stored Event objects as abci.Event objects.

func (*EventManager) EmitEvent

func (em *EventManager) EmitEvent(event Event)

EmitEvent stores a single Event object. Deprecated: Use EmitTypedEvent

func (*EventManager) EmitEvents

func (em *EventManager) EmitEvents(events Events)

EmitEvents stores a series of Event objects. Deprecated: Use EmitTypedEvents

func (*EventManager) EmitTypedEvent

func (em *EventManager) EmitTypedEvent(tev proto.Message) error

EmitTypedEvent takes typed event and emits converting it into Event

func (*EventManager) EmitTypedEvents

func (em *EventManager) EmitTypedEvents(tevs ...proto.Message) error

EmitTypedEvents takes series of typed events and emit

func (*EventManager) Events

func (em *EventManager) Events() Events

type Events

type Events []Event

Events defines a slice of Event objects

func EmptyEvents

func EmptyEvents() Events

EmptyEvents returns an empty slice of events.

func (Events) AppendEvent

func (e Events) AppendEvent(event Event) Events

AppendEvent adds an Event to a slice of events.

func (Events) AppendEvents

func (e Events) AppendEvents(events Events) Events

AppendEvents adds a slice of Event objects to an exist slice of Event objects.

func (Events) ToABCIEvents

func (e Events) ToABCIEvents() []abci.Event

ToABCIEvents converts a slice of Event objects to a slice of abci.Event objects.

type Fee

type Fee interface {
	GetGas() uint64
	GetAmount() costypes.CoinAdapters
}

Fee defines an interface for an application application-defined concrete transaction type to be able to set and return the transaction fee.

type FeeTx

type FeeTx interface {
	Tx
	GetGas() uint64
	GetFee() costypes.CoinAdapters
	FeePayer() costypes.AccAddress
	FeeGranter() costypes.AccAddress
}

FeeTx defines the interface to be implemented by Tx to use the FeeDecorators

type GasInfo

type GasInfo struct {
	// GasWanted is the maximum units of work we allow this tx to perform.
	GasWanted uint64 `protobuf:"varint,1,opt,name=gas_wanted,json=gasWanted,proto3" json:"gas_wanted,omitempty" yaml:"gas_wanted"`
	// GasUsed is the amount of gas actually consumed.
	GasUsed uint64 `protobuf:"varint,2,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty" yaml:"gas_used"`
}

GasInfo defines tx execution gas context.

func (*GasInfo) Descriptor

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

func (*GasInfo) GetGasUsed

func (m *GasInfo) GetGasUsed() uint64

func (*GasInfo) GetGasWanted

func (m *GasInfo) GetGasWanted() uint64

func (*GasInfo) Marshal

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

func (*GasInfo) MarshalTo

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

func (*GasInfo) MarshalToSizedBuffer

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

func (*GasInfo) ProtoMessage

func (*GasInfo) ProtoMessage()

func (*GasInfo) Reset

func (m *GasInfo) Reset()

func (*GasInfo) Size

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

func (GasInfo) String

func (gi GasInfo) String() string

func (*GasInfo) Unmarshal

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

func (*GasInfo) XXX_DiscardUnknown

func (m *GasInfo) XXX_DiscardUnknown()

func (*GasInfo) XXX_Marshal

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

func (*GasInfo) XXX_Merge

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

func (*GasInfo) XXX_Size

func (m *GasInfo) XXX_Size() int

func (*GasInfo) XXX_Unmarshal

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

type IBCTxEncoder

type IBCTxEncoder TxEncoder

type IbcTxDecoder

type IbcTxDecoder func(txBytes []byte) (*stdtx.IbcTx, error)

TxDecoder unmarshals transaction bytes type TxDecoder func(txBytes []byte) (costypes.Tx, error)

type Msg

type Msg interface {
	proto.Message

	// ValidateBasic does a simple validation check that
	// doesn't require access to any other information.
	ValidateBasic() error

	// Signers returns the addrs of signers that must sign.
	// CONTRACT: All signatures must be present to be valid.
	// CONTRACT: Returns addrs in some deterministic order.
	GetSigners() []costypes.AccAddress
}

Msg defines the interface a transaction message must fulfill.

type MsgData

type MsgData struct {
	MsgType string `protobuf:"bytes,1,opt,name=msg_type,json=msgType,proto3" json:"msg_type,omitempty"`
	Data    []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
}

MsgData defines the data returned in a Result object during message execution.

func (*MsgData) Descriptor

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

func (*MsgData) GetData

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

func (*MsgData) GetMsgType

func (m *MsgData) GetMsgType() string

func (*MsgData) Marshal

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

func (*MsgData) MarshalTo

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

func (*MsgData) MarshalToSizedBuffer

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

func (*MsgData) ProtoMessage

func (*MsgData) ProtoMessage()

func (*MsgData) Reset

func (m *MsgData) Reset()

func (*MsgData) Size

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

func (*MsgData) String

func (this *MsgData) String() string

func (*MsgData) Unmarshal

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

func (*MsgData) XXX_DiscardUnknown

func (m *MsgData) XXX_DiscardUnknown()

func (*MsgData) XXX_Marshal

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

func (*MsgData) XXX_Merge

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

func (*MsgData) XXX_Size

func (m *MsgData) XXX_Size() int

func (*MsgData) XXX_Unmarshal

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

type Result

type Result struct {
	// Data is any data returned from message or handler execution. It MUST be
	// length prefixed in order to separate data from multiple message executions.
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// Log contains the log information from message or handler execution.
	Log string `protobuf:"bytes,2,opt,name=log,proto3" json:"log,omitempty"`
	// Events contains a slice of Event objects that were emitted during message
	// or handler execution.
	Events []types1.Event `protobuf:"bytes,3,rep,name=events,proto3" json:"events"`
}

Result is the union of ResponseFormat and ResponseCheckTx.

func WrapServiceResult

func WrapServiceResult(ctx costypes.Context, res proto.Message, err error) (*Result, error)

WrapServiceResult wraps a result from a protobuf RPC service method call in a Result object or error. This method takes care of marshaling the res param to protobuf and attaching any events on the ctx.EventManager() to the Result.

func (*Result) Descriptor

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

func (Result) GetEvents

func (r Result) GetEvents() costypes.Events

func (*Result) Marshal

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

func (*Result) MarshalTo

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

func (*Result) MarshalToSizedBuffer

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

func (*Result) ProtoMessage

func (*Result) ProtoMessage()

func (*Result) Reset

func (m *Result) Reset()

func (*Result) Size

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

func (Result) String

func (r Result) String() string

func (*Result) Unmarshal

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

func (*Result) XXX_DiscardUnknown

func (m *Result) XXX_DiscardUnknown()

func (*Result) XXX_Marshal

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

func (*Result) XXX_Merge

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

func (*Result) XXX_Size

func (m *Result) XXX_Size() int

func (*Result) XXX_Unmarshal

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

type SearchTxsResult

type SearchTxsResult struct {
	// Count of all txs
	TotalCount uint64 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count" yaml:"total_count"`
	// Count of txs in current page
	Count uint64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"`
	// Index of current page, start from 1
	PageNumber uint64 `protobuf:"varint,3,opt,name=page_number,json=pageNumber,proto3" json:"page_number" yaml:"page_number"`
	// Count of total pages
	PageTotal uint64 `protobuf:"varint,4,opt,name=page_total,json=pageTotal,proto3" json:"page_total" yaml:"page_total"`
	// Max count txs per page
	Limit uint64 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"`
	// List of txs in current page
	Txs []*TxResponse `protobuf:"bytes,6,rep,name=txs,proto3" json:"txs,omitempty"`
}

SearchTxsResult defines a structure for querying txs pageable

func NewSearchTxsResult

func NewSearchTxsResult(totalCount, count, page, limit uint64, txs []*TxResponse) *SearchTxsResult

func (*SearchTxsResult) Descriptor

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

func (*SearchTxsResult) GetCount

func (m *SearchTxsResult) GetCount() uint64

func (*SearchTxsResult) GetLimit

func (m *SearchTxsResult) GetLimit() uint64

func (*SearchTxsResult) GetPageNumber

func (m *SearchTxsResult) GetPageNumber() uint64

func (*SearchTxsResult) GetPageTotal

func (m *SearchTxsResult) GetPageTotal() uint64

func (*SearchTxsResult) GetTotalCount

func (m *SearchTxsResult) GetTotalCount() uint64

func (*SearchTxsResult) GetTxs

func (m *SearchTxsResult) GetTxs() []*TxResponse

func (*SearchTxsResult) Marshal

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

func (*SearchTxsResult) MarshalTo

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

func (*SearchTxsResult) MarshalToSizedBuffer

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

func (*SearchTxsResult) ProtoMessage

func (*SearchTxsResult) ProtoMessage()

func (*SearchTxsResult) Reset

func (m *SearchTxsResult) Reset()

func (*SearchTxsResult) Size

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

func (*SearchTxsResult) String

func (this *SearchTxsResult) String() string

func (*SearchTxsResult) Unmarshal

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

func (SearchTxsResult) UnpackInterfaces

func (s SearchTxsResult) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error

UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces

types.UnpackInterfaces needs to be called for each nested Tx because there are generally interfaces to unpack in Tx's

func (*SearchTxsResult) XXX_DiscardUnknown

func (m *SearchTxsResult) XXX_DiscardUnknown()

func (*SearchTxsResult) XXX_Marshal

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

func (*SearchTxsResult) XXX_Merge

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

func (*SearchTxsResult) XXX_Size

func (m *SearchTxsResult) XXX_Size() int

func (*SearchTxsResult) XXX_Unmarshal

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

type Signature

type Signature interface {
	GetPubKey() cryptotypes.PubKey
	GetSignature() []byte
}

Signature defines an interface for an application application-defined concrete transaction type to be able to set and return transaction signatures.

type SimulationResponse

type SimulationResponse struct {
	GasInfo `protobuf:"bytes,1,opt,name=gas_info,json=gasInfo,proto3,embedded=gas_info" json:"gas_info"`
	Result  *Result `protobuf:"bytes,2,opt,name=result,proto3" json:"result,omitempty"`
}

SimulationResponse defines the response generated when a transaction is successfully simulated.

func (*SimulationResponse) Descriptor

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

func (*SimulationResponse) GetResult

func (m *SimulationResponse) GetResult() *Result

func (*SimulationResponse) Marshal

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

func (*SimulationResponse) MarshalTo

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

func (*SimulationResponse) MarshalToSizedBuffer

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

func (*SimulationResponse) ProtoMessage

func (*SimulationResponse) ProtoMessage()

func (*SimulationResponse) Reset

func (m *SimulationResponse) Reset()

func (*SimulationResponse) Size

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

func (*SimulationResponse) Unmarshal

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

func (*SimulationResponse) XXX_DiscardUnknown

func (m *SimulationResponse) XXX_DiscardUnknown()

func (*SimulationResponse) XXX_Marshal

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

func (*SimulationResponse) XXX_Merge

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

func (*SimulationResponse) XXX_Size

func (m *SimulationResponse) XXX_Size() int

func (*SimulationResponse) XXX_Unmarshal

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

type StringEvent

type StringEvent struct {
	Type       string      `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	Attributes []Attribute `protobuf:"bytes,2,rep,name=attributes,proto3" json:"attributes"`
}

StringEvent defines en Event object wrapper where all the attributes contain key/value pairs that are strings instead of raw bytes.

func StringifyEvent

func StringifyEvent(e abci.Event) StringEvent

StringifyEvent converts an Event object to a StringEvent object.

func (*StringEvent) Descriptor

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

func (*StringEvent) GetAttributes

func (m *StringEvent) GetAttributes() []Attribute

func (*StringEvent) GetType

func (m *StringEvent) GetType() string

func (*StringEvent) Marshal

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

func (*StringEvent) MarshalTo

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

func (*StringEvent) MarshalToSizedBuffer

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

func (*StringEvent) ProtoMessage

func (*StringEvent) ProtoMessage()

func (*StringEvent) Reset

func (m *StringEvent) Reset()

func (*StringEvent) Size

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

func (*StringEvent) String

func (this *StringEvent) String() string

func (*StringEvent) Unmarshal

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

func (*StringEvent) XXX_DiscardUnknown

func (m *StringEvent) XXX_DiscardUnknown()

func (*StringEvent) XXX_Marshal

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

func (*StringEvent) XXX_Merge

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

func (*StringEvent) XXX_Size

func (m *StringEvent) XXX_Size() int

func (*StringEvent) XXX_Unmarshal

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

type StringEvents

type StringEvents []StringEvent

StringAttributes defines a slice of StringEvents objects.

func StringifyEvents

func StringifyEvents(events []abci.Event) StringEvents

StringifyEvents converts a slice of Event objects into a slice of StringEvent objects.

func (StringEvents) Flatten

func (se StringEvents) Flatten() StringEvents

Flatten returns a flattened version of StringEvents by grouping all attributes per unique event type.

func (StringEvents) String

func (se StringEvents) String() string

type Tx

type Tx interface {
	// Gets the all the transaction's messages.
	GetMsgs() []Msg

	// ValidateBasic does a simple and lightweight validation check that doesn't
	// require access to any other information.
	ValidateBasic() error
}

Tx defines the interface a transaction must fulfill.

type TxEncoder

type TxEncoder func(tx Tx) ([]byte, error)

TxEncoder marshals transaction to bytes

type TxMsgData

type TxMsgData struct {
	Data []*MsgData `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"`
}

TxMsgData defines a list of MsgData. A transaction will have a MsgData object for each message.

func (*TxMsgData) Descriptor

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

func (*TxMsgData) GetData

func (m *TxMsgData) GetData() []*MsgData

func (*TxMsgData) Marshal

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

func (*TxMsgData) MarshalTo

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

func (*TxMsgData) MarshalToSizedBuffer

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

func (*TxMsgData) ProtoMessage

func (*TxMsgData) ProtoMessage()

func (*TxMsgData) Reset

func (m *TxMsgData) Reset()

func (*TxMsgData) Size

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

func (*TxMsgData) String

func (this *TxMsgData) String() string

func (*TxMsgData) Unmarshal

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

func (*TxMsgData) XXX_DiscardUnknown

func (m *TxMsgData) XXX_DiscardUnknown()

func (*TxMsgData) XXX_Marshal

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

func (*TxMsgData) XXX_Merge

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

func (*TxMsgData) XXX_Size

func (m *TxMsgData) XXX_Size() int

func (*TxMsgData) XXX_Unmarshal

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

type TxResponse

type TxResponse struct {
	// The block height
	Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
	// The transaction hash.
	TxHash string `protobuf:"bytes,2,opt,name=txhash,proto3" json:"txhash,omitempty"`
	// Namespace for the Code
	Codespace string `protobuf:"bytes,3,opt,name=codespace,proto3" json:"codespace,omitempty"`
	// Response code.
	Code uint32 `protobuf:"varint,4,opt,name=code,proto3" json:"code,omitempty"`
	// Result bytes, if any.
	Data string `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"`
	// The output of the application's logger (raw string). May be
	// non-deterministic.
	RawLog string `protobuf:"bytes,6,opt,name=raw_log,json=rawLog,proto3" json:"raw_log,omitempty"`
	// The output of the application's logger (typed). May be non-deterministic.
	Logs ABCIMessageLogs `protobuf:"bytes,7,rep,name=logs,proto3,castrepeated=ABCIMessageLogs" json:"logs"`
	// Additional information. May be non-deterministic.
	Info string `protobuf:"bytes,8,opt,name=info,proto3" json:"info,omitempty"`
	// Amount of gas requested for transaction.
	GasWanted int64 `protobuf:"varint,9,opt,name=gas_wanted,json=gasWanted,proto3" json:"gas_wanted,omitempty"`
	// Amount of gas consumed by transaction.
	GasUsed int64 `protobuf:"varint,10,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"`
	// The request transaction bytes.
	Tx *types.Any `protobuf:"bytes,11,opt,name=tx,proto3" json:"tx,omitempty"`
	// Time of the previous block. For heights > 1, it's the weighted median of
	// the timestamps of the valid votes in the block.LastCommit. For height == 1,
	// it's genesis time.
	Timestamp string `protobuf:"bytes,12,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// Events defines all the events emitted by processing a transaction. Note,
	// these events include those emitted by processing all the messages and those
	// emitted from the ante handler. Whereas Logs contains the events, with
	// additional metadata, emitted only by processing the messages.
	//
	// Since: cosmos-sdk 0.42.11, 0.44.5, 0.45
	Events []types1.Event `protobuf:"bytes,13,rep,name=events,proto3" json:"events"`
}

TxResponse defines a structure containing relevant tx data and metadata. The tags are stringified and the log is JSON decoded.

func NewResponseFormatBroadcastTx

func NewResponseFormatBroadcastTx(res *ctypes.ResultBroadcastTx) *TxResponse

NewResponseFormatBroadcastTx returns a TxResponse given a ResultBroadcastTx from tendermint

func NewResponseFormatBroadcastTxCommit

func NewResponseFormatBroadcastTxCommit(res *ctypes.ResultBroadcastTxCommit) *TxResponse

NewResponseFormatBroadcastTxCommit returns a TxResponse given a ResultBroadcastTxCommit from tendermint.

func NewResponseResultTx

func NewResponseResultTx(res *ctypes.ResultTx, anyTx *codectypes.Any, timestamp string) *TxResponse

NewResponseResultTx returns a TxResponse given a ResultTx from tendermint

func (*TxResponse) Descriptor

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

func (TxResponse) Empty

func (r TxResponse) Empty() bool

Empty returns true if the response is empty

func (TxResponse) GetTx

func (r TxResponse) GetTx() costypes.Tx

GetTx unpacks the Tx from within a TxResponse and returns it

func (*TxResponse) Marshal

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

func (*TxResponse) MarshalTo

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

func (*TxResponse) MarshalToSizedBuffer

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

func (*TxResponse) ProtoMessage

func (*TxResponse) ProtoMessage()

func (*TxResponse) Reset

func (m *TxResponse) Reset()

func (*TxResponse) Size

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

func (TxResponse) String

func (r TxResponse) String() string

func (*TxResponse) Unmarshal

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

func (TxResponse) UnpackInterfaces

func (r TxResponse) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error

UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces

func (*TxResponse) XXX_DiscardUnknown

func (m *TxResponse) XXX_DiscardUnknown()

func (*TxResponse) XXX_Marshal

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

func (*TxResponse) XXX_Merge

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

func (*TxResponse) XXX_Size

func (m *TxResponse) XXX_Size() int

func (*TxResponse) XXX_Unmarshal

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

type TxWithMemo

type TxWithMemo interface {
	Tx
	GetMemo() string
}

Tx must have GetMemo() method to use ValidateMemoDecorator

type TxWithTimeoutHeight

type TxWithTimeoutHeight interface {
	Tx

	GetTimeoutHeight() uint64
}

TxWithTimeoutHeight extends the Tx interface by allowing a transaction to set a height timeout.

Jump to

Keyboard shortcuts

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