models

package
v0.0.90 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	ID      uint
	Address string `gorm:"uniqueIndex"`
}

type AuthInfo

type AuthInfo struct {
	ID          uint `gorm:"primarykey"`
	FeeID       uint
	Fee         AuthInfoFee `gorm:"foreignKey:FeeID"`
	TipID       uint
	Tip         Tip           `gorm:"foreignKey:TipID"`
	SignerInfos []*SignerInfo `gorm:"many2many:tx_signer_infos;"`
}

func (AuthInfo) TableName

func (AuthInfo) TableName() string

type AuthInfoFee

type AuthInfoFee struct {
	ID       uint
	GasLimit uint64
	Payer    string
	Granter  string
}

func (AuthInfoFee) TableName

func (AuthInfoFee) TableName() string

type Block

type Block struct {
	ID                    uint
	TimeStamp             time.Time
	Height                int64 `gorm:"uniqueIndex:chainheight"`
	ChainID               uint  `gorm:"uniqueIndex:chainheight"`
	Chain                 Chain
	ProposerConsAddress   Address
	ProposerConsAddressID uint
	TxIndexed             bool
	TotalTxs              int
	// TODO: Should block event indexing be split out or rolled up?
	BlockEventsIndexed bool
	BlockHash          string
	Signatures         []BlockSignature
}

type BlockEvent

type BlockEvent struct {
	ID uint
	// These fields uniquely identify every block event
	// Index refers to the position of the event in the block event lifecycle array
	// LifecyclePosition refers to whether the event is a BeginBlock or EndBlock event
	Index             uint64                 `gorm:"uniqueIndex:eventBlockPositionIndex,priority:3"`
	LifecyclePosition BlockLifecyclePosition `gorm:"uniqueIndex:eventBlockPositionIndex,priority:2"`
	BlockID           uint                   `gorm:"uniqueIndex:eventBlockPositionIndex,priority:1"`
	Block             Block
	BlockEventTypeID  uint
	BlockEventType    BlockEventType
}

type BlockEventAttribute

type BlockEventAttribute struct {
	ID           uint
	BlockEvent   BlockEvent
	BlockEventID uint `gorm:"uniqueIndex:eventAttributeIndex,priority:1"`
	Value        string
	Index        uint64 `gorm:"uniqueIndex:eventAttributeIndex,priority:2"`
	// Keys are limited to a smallish subset of string values set by the Cosmos SDK and external modules
	// Save DB space by storing the key as a foreign key
	BlockEventAttributeKeyID uint
	BlockEventAttributeKey   BlockEventAttributeKey
}

type BlockEventAttributeKey

type BlockEventAttributeKey struct {
	ID  uint
	Key string `gorm:"uniqueIndex"`
}

type BlockEventParser

type BlockEventParser struct {
	ID                     uint
	BlockLifecyclePosition BlockLifecyclePosition `gorm:"uniqueIndex:idx_block_event_parser_identifier_lifecycle_position"`
	Identifier             string                 `gorm:"uniqueIndex:idx_block_event_parser_identifier_lifecycle_position"`
}

type BlockEventParserError

type BlockEventParserError struct {
	ID                 uint
	BlockEventParserID uint
	BlockEventParser   BlockEventParser
	BlockEventID       uint
	BlockEvent         BlockEvent
	Error              string
}

type BlockEventType

type BlockEventType struct {
	ID   uint
	Type string `gorm:"uniqueIndex"`
}

type BlockLifecyclePosition

type BlockLifecyclePosition int

Used to keep track of BeginBlock and EndBlock events

const (
	BeginBlockEvent BlockLifecyclePosition = iota
	EndBlockEvent
)

type BlockSignature

type BlockSignature struct {
	ID               uint
	BlockID          uint64 `gorm:"uniqueIndex:idx_bl_signature"`
	Block            Block
	ValidatorAddress string `gorm:"uniqueIndex:idx_bl_signature"`
	Timestamp        time.Time
	Signature        []byte `gorm:"type:bytea"`
}

type Chain

type Chain struct {
	ID      uint   `gorm:"primaryKey"`
	ChainID string `gorm:"uniqueIndex"` // e.g. osmosis-1
	Name    string // e.g. Osmosis
}

type Denom

type Denom struct {
	ID   uint
	Base string `gorm:"uniqueIndex"`
}

type FailedBlock

type FailedBlock struct {
	ID           uint
	Height       int64 `gorm:"uniqueIndex:failedchainheight"`
	BlockchainID uint  `gorm:"uniqueIndex:failedchainheight"`
	Chain        Chain `gorm:"foreignKey:BlockchainID"`
}

type FailedEventBlock

type FailedEventBlock struct {
	ID           uint
	Height       int64 `gorm:"uniqueIndex:failedchaineventheight"`
	BlockchainID uint  `gorm:"uniqueIndex:failedchaineventheight"`
	Chain        Chain `gorm:"foreignKey:BlockchainID"`
}

type FailedMessage

type FailedMessage struct {
	ID           uint
	MessageIndex int
	TxID         uint
	Tx           Tx
}

type FailedTx

type FailedTx struct {
	ID      uint
	Hash    string `gorm:"uniqueIndex"`
	BlockID uint
	Block   Block
}

type Fee

type Fee struct {
	ID             uint            `gorm:"primaryKey"`
	TxID           uint            `gorm:"uniqueIndex:txDenomFee"`
	Amount         decimal.Decimal `gorm:"type:decimal(78,0);"`
	DenominationID uint            `gorm:"uniqueIndex:txDenomFee"`
	Denomination   Denom           `gorm:"foreignKey:DenominationID"`
	PayerAddressID uint            `gorm:"index:idx_payer_addr"`
	PayerAddress   Address         `gorm:"foreignKey:PayerAddressID"`
}

func (*Fee) BeforeCreate

func (b *Fee) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate This lifecycle function ensures the on conflict statement is added for Fees which are associated to Txes by the Gorm slice association method for has_many

type InfoFeeAmount

type InfoFeeAmount struct {
	ID     uint            `gorm:"primaryKey"`
	Amount decimal.Decimal `gorm:"type:decimal(78,0);"`
	Denom  string
}

func (InfoFeeAmount) TableName

func (InfoFeeAmount) TableName() string

type Message

type Message struct {
	ID            uint
	TxID          uint `gorm:"uniqueIndex:messageIndex,priority:1"`
	Tx            Tx
	MessageTypeID uint `gorm:"foreignKey:MessageTypeID,index:idx_txid_typeid"`
	MessageType   MessageType
	MessageIndex  int `gorm:"uniqueIndex:messageIndex,priority:2"`
	MessageBytes  []byte
}

type MessageEvent

type MessageEvent struct {
	ID uint
	// These fields uniquely identify every message event
	// Index refers to the position of the event in the message event array
	Index              uint64 `gorm:"uniqueIndex:messageEventIndex,priority:2"`
	MessageID          uint   `gorm:"uniqueIndex:messageEventIndex,priority:1"`
	Message            Message
	MessageEventTypeID uint
	MessageEventType   MessageEventType
}

type MessageEventAttribute

type MessageEventAttribute struct {
	ID             uint
	MessageEvent   MessageEvent
	MessageEventID uint `gorm:"uniqueIndex:messageAttributeIndex,priority:1"`
	Value          string
	Index          uint64 `gorm:"uniqueIndex:messageAttributeIndex,priority:2"`
	// Keys are limited to a smallish subset of string values set by the Cosmos SDK and external modules
	// Save DB space by storing the key as a foreign key
	MessageEventAttributeKeyID uint
	MessageEventAttributeKey   MessageEventAttributeKey
}

type MessageEventAttributeKey

type MessageEventAttributeKey struct {
	ID  uint
	Key string `gorm:"uniqueIndex"`
}

type MessageEventType

type MessageEventType struct {
	ID   uint
	Type string `gorm:"uniqueIndex"`
}

type MessageType

type MessageType struct {
	ID          uint   `gorm:"primaryKey"`
	MessageType string `gorm:"uniqueIndex;not null"`
}

type SignerInfo

type SignerInfo struct {
	ID        uint
	AddressID uint
	Address   *Address `gorm:"foreignKey:AddressID"`
	ModeInfo  string
	Sequence  uint64
}

func (SignerInfo) TableName

func (SignerInfo) TableName() string

type Tip

type Tip struct {
	ID     uint
	Tipper string
	Amount []TipAmount `gorm:"foreignKey:ID"`
}

func (Tip) TableName

func (Tip) TableName() string

type TipAmount

type TipAmount struct {
	ID     uint            `gorm:"primaryKey"`
	Amount decimal.Decimal `gorm:"type:decimal(78,0);"`
	Denom  string
}

func (TipAmount) TableName

func (TipAmount) TableName() string

type Tx

type Tx struct {
	ID                          uint
	Hash                        string `gorm:"uniqueIndex"`
	Code                        uint32
	BlockID                     uint
	Block                       Block
	SignerAddresses             []Address `gorm:"many2many:tx_signer_addresses;"`
	Fees                        []Fee
	Signatures                  pq.ByteaArray `gorm:"type:bytea[]" json:"signatures"`
	Timestamp                   time.Time
	Memo                        string
	TimeoutHeight               uint64
	ExtensionOptions            pq.StringArray `gorm:"type:text[]" json:"extension_options"`
	NonCriticalExtensionOptions pq.StringArray `gorm:"type:text[]" json:"non_critical_options"`
	AuthInfoID                  uint
	AuthInfo                    AuthInfo `gorm:"foreignKey:AuthInfoID;belongsTo"`
	TxResponseID                uint
	TxResponse                  TxResponse              `gorm:"foreignKey:TxResponseID;belongsTo"`
	SenderReceiver              *model.TxSenderReceiver `gorm:"-" json:"sender_receiver"`
	Events                      []*model.TxEvents       `gorm:"-" json:"events"`
}

type TxDelegateAggregated

type TxDelegateAggregated struct {
	ID          uint
	Hash        string `gorm:"uniqueIndex"`
	TxType      string
	Timestamp   time.Time
	Validator   string
	BlockHeight int64
	Amount      decimal.Decimal `gorm:"type:decimal(78,0);"`
	Denom       string
	Sender      string
}

type TxEventsAggregated added in v0.0.81

type TxEventsAggregated struct {
	ID                    uint
	TxHash                string `gorm:"uniqueIndex:txEventsAggregatedIndex"`
	MessageType           string `gorm:"uniqueIndex:txEventsAggregatedIndex"`
	MessageTypeIndex      int    `gorm:"uniqueIndex:txEventsAggregatedIndex"`
	MessageEventType      string `gorm:"uniqueIndex:txEventsAggregatedIndex"`
	MessageEventAttrIndex int    `gorm:"uniqueIndex:txEventsAggregatedIndex"`
	MessageEventAttrValue string
	MessageEventAttrKey   string `gorm:"uniqueIndex:txEventsAggregatedIndex"`
}

type TxEventsValsAggregated added in v0.0.78

type TxEventsValsAggregated struct {
	ID          uint
	EvAttrValue string `gorm:"uniqueIndex:txEventsValsAggregatedIndex"`
	MsgType     string `gorm:"uniqueIndex:txEventsValsAggregatedIndex"`
	TxHash      string `gorm:"uniqueIndex:txEventsValsAggregatedIndex"`
	TxTimestamp time.Time
}

type TxResponse

type TxResponse struct {
	ID        uint
	TxHash    string `gorm:"uniqueIndex"`
	Height    string
	TimeStamp string
	Code      uint32
	RawLog    []byte `gorm:"type:bytea"`
	// Log       []LogMessage
	GasUsed   int64
	GasWanted int64
	Codespace string
	Data      string
	Info      string
}

func (TxResponse) TableName

func (TxResponse) TableName() string

Jump to

Keyboard shortcuts

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