sub

package
v0.10.20 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const TxDeliverTopic = pubsub.Topic("TxDeliver")

---------------------------------------------------------------------

Variables

This section is empty.

Functions

func Clear

func Clear()

func SetMeta

func SetMeta(height int64, timestamp time.Time, isBreatheBlock bool)

func SubscribeCrossTransferEvent

func SubscribeCrossTransferEvent(sub *pubsub.Subscriber) error

func SubscribeEvent

func SubscribeEvent(sub *pubsub.Subscriber, cfg *config.PublicationConfig) error

func SubscribeMirrorEvent

func SubscribeMirrorEvent(sub *pubsub.Subscriber) error

func SubscribeOracleEvent

func SubscribeOracleEvent(sub *pubsub.Subscriber) error

func SubscribeSlashEvent

func SubscribeSlashEvent(sub *pubsub.Subscriber) error

func SubscribeStakeEvent

func SubscribeStakeEvent(sub *pubsub.Subscriber) error

Types

type CompletedUBD

type CompletedUBD struct {
	Validator sdk.ValAddress
	Delegator sdk.AccAddress
	Amount    sdk.Coin
}

type EventStore

type EventStore struct {
	// store for stake topic
	StakeData *StakeData
	// store for slash topic
	SlashData map[string][]SlashData
	// store for cross chain transfer topic
	CrossTransferData []pubsub.CrossTransferEvent
	// store for mirror topic
	MirrorData []bridge.MirrorEvent
}

type SlashData

type SlashData struct {
	Validator              sdk.ValAddress
	InfractionType         byte
	InfractionHeight       int64
	JailUtil               time.Time
	SlashAmount            int64
	ToFeePool              int64
	Submitter              sdk.AccAddress
	SubmitterReward        int64
	ValidatorsCompensation map[string]int64
}

type StakeData

type StakeData struct {
	// stash for stake topic
	Distribution         map[string][]stake.DistributionData             // ChainId -> []DistributionData
	CompletedUBDs        map[string][]CompletedUBD                       // ChainId -> []CompletedUBD
	CompletedREDs        map[string][]types.DVVTriplet                   // ChainId -> []DVVTriplet
	Validators           map[string]stake.Validator                      // operator(string) -> validator
	RemovedValidators    map[string][]sdk.ValAddress                     // ChainId -> []sdk.ValAddress
	Delegations          map[string]map[string]stake.Delegation          // ChainId -> delegator+validator -> Delegation
	RemovedDelegations   map[string][]types.DVPair                       // ChainId -> []DVPair
	UnbondingDelegations map[string]map[string]stake.UnbondingDelegation // ChainId -> delegator+validator -> UBD
	ReDelegations        map[string]map[string]stake.Redelegation        // ChainId -> delegator+srcValidator+dstValidator -> RED
	DelegateEvents       map[string][]stake.DelegateEvent                // ChainId -> delegate event
	UndelegateEvents     map[string][]stake.UndelegateEvent              // ChainId -> undelegate event
	RedelegateEvents     map[string][]stake.RedelegateEvent              // ChainId -> redelegate event
	ElectedValidators    map[string][]stake.Validator                    // ChainId -> elected validators
}

type ToPublishEvent

type ToPublishEvent struct {
	Height         int64
	Timestamp      time.Time
	IsBreatheBlock bool
	EventData      *EventStore
}

func ToPublish

func ToPublish() *ToPublishEvent

type TxDeliverEvent

type TxDeliverEvent struct{}

func (TxDeliverEvent) GetTopic

func (event TxDeliverEvent) GetTopic() pubsub.Topic

type TxDeliverFailEvent

type TxDeliverFailEvent struct {
	TxDeliverEvent
}

type TxDeliverSuccEvent

type TxDeliverSuccEvent struct {
	TxDeliverEvent
}

Jump to

Keyboard shortcuts

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