fsm

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PscTrustOpened = "TRUST_OPENED"
	// client waiting for instantiating tcb tx, after tx is mined,
	// state will move to PscOpen
	PscInstantiatingTCB = "INSTANTIATING_TCB"
	PscOpen             = "OPENED"
	PscDispute          = "DISPUTING"
	PscClosed           = "CLOSED"
)

do NOT modify the string representation of existing states

View Source
const (
	PayOneSigPending    = "ONESIG_PENDING"
	PayCoSignedPending  = "COSIGNED_PENDING"
	PayHashLockRevealed = "HASHLOCK_REVEALED" // only valid for pay src or dst
	PayOneSigPaid       = "ONESIG_PAID"
	PayCoSignedPaid     = "COSIGNED_PAID"
	PayOneSigCanceled   = "ONESIG_CANCELED"
	PayCoSignedCanceled = "COSIGNED_CANCELED"
	PayOneSigNacked     = "PAY_NACKED"       // one-sig simplex rejected by the peer_to
	PayIngressRejected  = "INGRESS_REJECTED" // after sending pay settle proof(cancel), dst should record this state
)

do NOT modify the string representation of existing states

Variables

This section is empty.

Functions

func ChanStateName

func ChanStateName(state int) string

func IsChanStateChangeValid

func IsChanStateChangeValid(old, new int) bool

IsChanStateChangeValid returns true if new state is possible to reach in channel lifecycle also return true if new == old

func OnChannelConfirmSettle

func OnChannelConfirmSettle(tx *storage.DALTx, args ...interface{}) error

func OnChannelIntendSettle

func OnChannelIntendSettle(tx *storage.DALTx, args ...interface{}) error

func OnChannelUpdate

func OnChannelUpdate(cid ctype.CidType, currState int) error

func OnCondPayRequestSent

func OnCondPayRequestSent(
	tx *storage.DALTx, payID ctype.PayIDType, cid ctype.CidType, directPay bool) (bool, int, error)

return exist, newstate, err

func OnPayEgressCoSignedCanceled

func OnPayEgressCoSignedCanceled(tx *storage.DALTx, payID ctype.PayIDType) error

func OnPayEgressCoSignedPaid

func OnPayEgressCoSignedPaid(tx *storage.DALTx, payID ctype.PayIDType) error

func OnPayEgressDelivered

func OnPayEgressDelivered(tx *storage.DALTx, payID ctype.PayIDType) error

func OnPayEgressNacked

func OnPayEgressNacked(tx *storage.DALTx, payID ctype.PayIDType) error

func OnPayEgressOneSigCanceled

func OnPayEgressOneSigCanceled(tx *storage.DALTx, payID ctype.PayIDType, egstate int) error

func OnPayEgressOneSigPaid

func OnPayEgressOneSigPaid(tx *storage.DALTx, payID ctype.PayIDType, egstate int) error

func OnPayEgressSecretRevealed

func OnPayEgressSecretRevealed(tx *storage.DALTx, payID ctype.PayIDType, state int) error

func OnPayEgressUpdateAfterNack

func OnPayEgressUpdateAfterNack(tx *storage.DALTx, payID ctype.PayIDType) error

func OnPayIngressCoSignedCanceled

func OnPayIngressCoSignedCanceled(tx *storage.DALTx, payID ctype.PayIDType, state int) error

func OnPayIngressCoSignedPaid

func OnPayIngressCoSignedPaid(tx *storage.DALTx, payID ctype.PayIDType, state int) error

func OnPayIngressRejected

func OnPayIngressRejected(tx *storage.DALTx, payID ctype.PayIDType, state int) error

OnPayIngressRejected converts the payment status to ingress rejected after sending pay settle proof(cancel).

func OnPayIngressSecretRevealed

func OnPayIngressSecretRevealed(tx *storage.DALTx, payID ctype.PayIDType, state int) error

func PayStateName

func PayStateName(state int) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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