types

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: GPL-3.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

View Source
const (
	CodeEventRecordAlreadySynced sdk.CodeType = 5400
	CodeEventRecordInvalid       sdk.CodeType = 5401
	CodeEventRecordUpdate        sdk.CodeType = 5402
	CodeSizeExceed               sdk.CodeType = 5403
)

Bank errors reserve 5400 ~ 5499.

View Source
const (
	// ModuleName is the name of the module
	ModuleName = "clerk"

	// StoreKey is the store key string for bor
	StoreKey = ModuleName

	// RouterKey is the message route for bor
	RouterKey = ModuleName

	// QuerierRoute is the querier route for bor
	QuerierRoute = ModuleName

	// DefaultParamspace default name for parameter store
	DefaultParamspace = ModuleName

	// DefaultCodespace default code space
	DefaultCodespace sdk.CodespaceType = ModuleName
)
View Source
const (
	QueryRecord             = "record"
	QueryRecordList         = "record-list"
	QueryRecordListWithTime = "record-list-time"
	QueryRecordSequence     = "record-sequence"
)

query endpoints supported by the auth Querier

Variables

View Source
var (
	EventTypeRecord = "record"

	AttributeKeyRecordTxHash     = "record-tx-hash"
	AttributeKeyRecordTxLogIndex = "record-tx-log-index"
	AttributeKeyRecordID         = "record-id"
	AttributeKeyRecordContract   = "record-contract"
	AttributeKeyCreatedAt        = "created-at"

	AttributeValueCategory = ModuleName
)
View Source
var ModuleCdc = codec.New()

ModuleCdc module cdc

Functions

func ErrEventRecordAlreadySynced

func ErrEventRecordAlreadySynced(codespace sdk.CodespaceType) sdk.Error

ErrEventRecordAlreadySynced represents event sync error

func ErrEventRecordInvalid

func ErrEventRecordInvalid(codespace sdk.CodespaceType) sdk.Error

ErrEventRecordInvalid represents event error

func ErrEventUpdate

func ErrEventUpdate(codespace sdk.CodespaceType) sdk.Error

ErrEventUpdates represent event update error

func ErrSizeExceed added in v0.2.5

func ErrSizeExceed(codespace sdk.CodespaceType) sdk.Error

ErrSizeExceed represents event data size exceed error

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete types on codec codec

func ValidateGenesis

func ValidateGenesis(data GenesisState) error

ValidateGenesis performs basic validation of bank genesis data returning an error for any failed validation criteria.

Types

type EventRecord

type EventRecord struct {
	ID         uint64                `json:"id" yaml:"id"`
	Contract   types.HeimdallAddress `json:"contract" yaml:"contract"`
	Data       types.HexBytes        `json:"data" yaml:"data"`
	TxHash     types.HeimdallHash    `json:"tx_hash" yaml:"tx_hash"`
	LogIndex   uint64                `json:"log_index" yaml:"log_index"`
	ChainID    string                `json:"bor_chain_id" yaml:"bor_chain_id"`
	RecordTime time.Time             `json:"record_time" yaml:"record_time"`
}

EventRecord represents state record

func NewEventRecord

func NewEventRecord(
	txHash types.HeimdallHash,
	logIndex uint64,
	id uint64,
	contract types.HeimdallAddress,
	data types.HexBytes,
	chainID string,
	recordTime time.Time,
) EventRecord

NewEventRecord creates new record

func (*EventRecord) String

func (s *EventRecord) String() string

String returns the string representation of span

type GenesisState

type GenesisState struct {
	EventRecords    []*EventRecord `json:"event_records"`
	RecordSequences []string       `json:"record_sequences" yaml:"record_sequences"`
}

GenesisState is the bank state that must be provided at genesis.

func DefaultGenesisState

func DefaultGenesisState() GenesisState

DefaultGenesisState returns a default genesis state

func NewGenesisState

func NewGenesisState(eventRecords []*EventRecord, recordSequences []string) GenesisState

NewGenesisState creates a new genesis state.

type MsgEventRecord

type MsgEventRecord struct {
	From            types.HeimdallAddress `json:"from"`
	TxHash          types.HeimdallHash    `json:"tx_hash"`
	LogIndex        uint64                `json:"log_index"`
	BlockNumber     uint64                `json:"block_number"`
	ContractAddress types.HeimdallAddress `json:"contract_address"`
	Data            types.HexBytes        `json:"data"`
	ID              uint64                `json:"id"`
	ChainID         string                `json:"bor_chain_id"`
}

MsgEventRecord - state msg

func NewMsgEventRecord

func NewMsgEventRecord(
	from types.HeimdallAddress,
	txHash types.HeimdallHash,
	logIndex uint64,
	blockNumber uint64,
	id uint64,
	contractAddress types.HeimdallAddress,
	data types.HexBytes,
	chainID string,

) MsgEventRecord

NewMsgEventRecord - construct state msg

func (MsgEventRecord) GetLogIndex

func (msg MsgEventRecord) GetLogIndex() uint64

GetLogIndex Returns log index

func (MsgEventRecord) GetSideSignBytes added in v0.1.7

func (msg MsgEventRecord) GetSideSignBytes() []byte

GetSideSignBytes returns side sign bytes

func (MsgEventRecord) GetSignBytes

func (msg MsgEventRecord) GetSignBytes() []byte

GetSignBytes Implements Msg.

func (MsgEventRecord) GetSigners

func (msg MsgEventRecord) GetSigners() []sdk.AccAddress

GetSigners Implements Msg.

func (MsgEventRecord) GetTxHash

func (msg MsgEventRecord) GetTxHash() types.HeimdallHash

GetTxHash Returns tx hash

func (MsgEventRecord) Route

func (msg MsgEventRecord) Route() string

Route Implements Msg.

func (MsgEventRecord) Type

func (msg MsgEventRecord) Type() string

Type Implements Msg.

func (MsgEventRecord) ValidateBasic

func (msg MsgEventRecord) ValidateBasic() sdk.Error

ValidateBasic Implements Msg.

type QueryRecordParams

type QueryRecordParams struct {
	RecordID uint64
}

QueryRecordParams defines the params for querying accounts.

func NewQueryRecordParams

func NewQueryRecordParams(recordID uint64) QueryRecordParams

NewQueryRecordParams creates a new instance of QueryRecordParams.

type QueryRecordSequenceParams added in v0.1.5

type QueryRecordSequenceParams struct {
	TxHash   string
	LogIndex uint64
}

QueryRecordSequenceParams defines the params for querying an account Sequence.

func NewQueryRecordSequenceParams added in v0.1.5

func NewQueryRecordSequenceParams(txHash string, logIndex uint64) QueryRecordSequenceParams

NewQueryRecordSequenceParams creates a new instance of QuerySequenceParams.

type QueryRecordTimePaginationParams added in v0.1.7

type QueryRecordTimePaginationParams struct {
	FromTime time.Time
	ToTime   time.Time
	Page     uint64
	Limit    uint64
}

QueryRecordTimePaginationParams defines the params for querying records with time.

func NewQueryTimeRangePaginationParams added in v0.1.7

func NewQueryTimeRangePaginationParams(fromTime, toTime time.Time, page, limit uint64) QueryRecordTimePaginationParams

NewQueryTimeRangePaginationParams creates a new instance of NewQueryTimeRangePaginationParams.

Jump to

Keyboard shortcuts

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