monitor

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2020 License: GPL-3.0 Imports: 36 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ChanInfoState_Null            uint8 = 0
	ChanInfoState_CaughtWithdraw  uint8 = 1
	ChanInfoState_GuardedWithdraw uint8 = 2
	ChanInfoState_CaughtSettle    uint8 = 3
	ChanInfoState_GuardedSettle   uint8 = 4
)

Variables

View Source
var (
	PullerKeyPrefix  = []byte{0x01} // Key prefix for puller
	GuardKeyPrefix   = []byte{0x02} // Key prefix for guard
	PenaltyKeyPrefix = []byte{0x03} // Key prefix for penalty
)

Functions

func GetGuardKey added in v0.2.0

func GetGuardKey(cid mainchain.CidType, simplexReceiver mainchain.Addr) []byte

get guard key from mainchain txHash

func GetPenaltyKey

func GetPenaltyKey(nonce uint64) []byte

get penalty key from nonce

func GetPullerKey

func GetPullerKey(txHash mainchain.HashType) []byte

get puller key from mainchain txHash

func NewMonitor added in v0.2.0

func NewMonitor(ethClient *mainchain.EthClient, operator *transactor.Transactor, db dbm.DB)

Types

type ChanInfo added in v0.2.0

type ChanInfo struct {
	Cid             mainchain.CidType
	SimplexReceiver mainchain.Addr
	SeqNum          uint64
	State           uint8
}

type EventName

type EventName string
const (
	UpdateSidechainAddr   EventName = "UpdateSidechainAddr"
	ConfirmParamProposal  EventName = "ConfirmParamProposal"
	Delegate              EventName = "Delegate"
	CandidateUnbonded     EventName = "CandidateUnbonded"
	ValidatorChange       EventName = "ValidatorChange"
	IntendSettle          EventName = "IntendSettle"
	IntendWithdraw        EventName = "IntendWithdraw"
	IntendWithdrawDpos    EventName = "IntendWithdrawDpos"
	IntendWithdrawChannel EventName = "IntendWithdrawChannel"
)

type EventWrapper

type EventWrapper struct {
	Name EventName `json:"name"`
	Log  types.Log `json:"log"`
}

Wrapper for ethereum Event

func NewEvent

func NewEvent(name EventName, l types.Log) *EventWrapper

func NewEventFromBytes

func NewEventFromBytes(input []byte) *EventWrapper

func (*EventWrapper) MustMarshal

func (e *EventWrapper) MustMarshal() []byte

Marshal event into json bytes

func (*EventWrapper) MustUnMarshal

func (e *EventWrapper) MustUnMarshal(input []byte)

Unmarshal json bytes to event

func (*EventWrapper) ParseEvent

func (e *EventWrapper) ParseEvent(ethClient *mainchain.EthClient) interface{}

type Monitor added in v0.2.0

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

type MonitorContractInfo added in v0.2.0

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

func NewMonitorContractInfo added in v0.2.0

func NewMonitorContractInfo(address mainchain.Addr, abi string) *MonitorContractInfo

func (*MonitorContractInfo) GetABI added in v0.2.0

func (info *MonitorContractInfo) GetABI() string

func (*MonitorContractInfo) GetAddr added in v0.2.0

func (info *MonitorContractInfo) GetAddr() mainchain.Addr

type PenaltyEvent

type PenaltyEvent struct {
	Nonce      uint64 `json:"nonce"`
	RetryCount uint64 `json:"retryCount"`
}

func NewPenaltyEvent

func NewPenaltyEvent(nonce uint64) PenaltyEvent

func NewPenaltyEventFromBytes

func NewPenaltyEventFromBytes(input []byte) PenaltyEvent

func (PenaltyEvent) MustMarshal

func (e PenaltyEvent) MustMarshal() []byte

Marshal event into json bytes

func (*PenaltyEvent) MustUnMarshal

func (e *PenaltyEvent) MustUnMarshal(input []byte)

Unmarshal json bytes to penalty event

Jump to

Keyboard shortcuts

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