events

package
v1.2.1-testnet-rc7 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeRewardEvent    = "minter/RewardEvent"
	TypeSlashEvent     = "minter/SlashEvent"
	TypeUnbondEvent    = "minter/UnbondEvent"
	TypeStakeKickEvent = "minter/StakeKickEvent"
)

Event type names

Variables

This section is empty.

Functions

func RegisterAminoEvents

func RegisterAminoEvents(codec *amino.Codec)

Types

type Event

type Event interface {
	Type() string
	AddressString() string
	ValidatorPubKeyString() string
	// contains filtered or unexported methods
}

type Events

type Events []Event

type IEventsDB

type IEventsDB interface {
	AddEvent(height uint32, event Event)
	LoadEvents(height uint32) Events
	CommitEvents() error
}

IEventsDB is an interface of Events

func NewEventsStore

func NewEventsStore(db db.DB) IEventsDB

NewEventsStore creates new events store in given DB

type RewardEvent

type RewardEvent struct {
	Role            string        `json:"role"`
	Address         types.Address `json:"address"`
	Amount          string        `json:"amount"`
	ValidatorPubKey types.Pubkey  `json:"validator_pub_key"`
}

func (*RewardEvent) AddressString

func (re *RewardEvent) AddressString() string

func (*RewardEvent) Type

func (re *RewardEvent) Type() string

func (*RewardEvent) ValidatorPubKeyString

func (re *RewardEvent) ValidatorPubKeyString() string

type Role

type Role byte
const (
	RoleValidator Role = iota
	RoleDelegator
	RoleDAO
	RoleDevelopers
)

func NewRole

func NewRole(r string) Role

func (Role) String

func (r Role) String() string

type SlashEvent

type SlashEvent struct {
	Address         types.Address `json:"address"`
	Amount          string        `json:"amount"`
	Coin            uint64        `json:"coin"`
	ValidatorPubKey types.Pubkey  `json:"validator_pub_key"`
}

func (*SlashEvent) AddressString

func (se *SlashEvent) AddressString() string

func (*SlashEvent) Type

func (se *SlashEvent) Type() string

func (*SlashEvent) ValidatorPubKeyString

func (se *SlashEvent) ValidatorPubKeyString() string

type StakeKickEvent

type StakeKickEvent struct {
	Address         types.Address `json:"address"`
	Amount          string        `json:"amount"`
	Coin            uint64        `json:"coin"`
	ValidatorPubKey types.Pubkey  `json:"validator_pub_key"`
}

func (*StakeKickEvent) AddressString

func (ue *StakeKickEvent) AddressString() string

func (*StakeKickEvent) Type

func (ue *StakeKickEvent) Type() string

func (*StakeKickEvent) ValidatorPubKeyString

func (ue *StakeKickEvent) ValidatorPubKeyString() string

type UnbondEvent

type UnbondEvent struct {
	Address         types.Address `json:"address"`
	Amount          string        `json:"amount"`
	Coin            uint64        `json:"coin"`
	ValidatorPubKey types.Pubkey  `json:"validator_pub_key"`
}

func (*UnbondEvent) AddressString

func (ue *UnbondEvent) AddressString() string

func (*UnbondEvent) Type

func (ue *UnbondEvent) Type() string

func (*UnbondEvent) ValidatorPubKeyString

func (ue *UnbondEvent) ValidatorPubKeyString() string

Jump to

Keyboard shortcuts

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