locked

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWrongInType  = errors.New("wrong input type")
	ErrWrongOutType = errors.New("wrong output type")
)
View Source
var IDsEmpty = IDs{ids.Empty, ids.Empty}
View Source
var (
	ThisTxID = ids.ID{'t', 'h', 'i', 's', ' ', 't', 'x', ' ', 'i', 'd'}
)

Functions

func VerifyLockMode

func VerifyLockMode(
	ins []*avax.TransferableInput,
	outs []*avax.TransferableOutput,
	lockModeDepositBond bool,
) error

Verifies that [ins] and [outs] have allowed types depending on [lockModeBonding]. If lockModeBonding is true, than ins and outs can't be stakeable types. If lockModeBonding is false, than ins and outs can't be locked types.

func VerifyNoLocks

func VerifyNoLocks(
	ins []*avax.TransferableInput,
	outs []*avax.TransferableOutput,
) error

Verifies that [ins] and [outs] aren't stakeable or locked types.

Types

type IDs

type IDs struct {
	DepositTxID ids.ID `serialize:"true" json:"depositTxID"`
	BondTxID    ids.ID `serialize:"true" json:"bondTxID"`
}

func (*IDs) FixLockID

func (lock *IDs) FixLockID(txID ids.ID, appliedLockState State)

func (IDs) IsLocked

func (lock IDs) IsLocked() bool

func (IDs) IsLockedWith

func (lock IDs) IsLockedWith(lockState State) bool

func (IDs) IsNewlyLockedWith

func (lock IDs) IsNewlyLockedWith(lockState State) bool

func (IDs) Lock

func (lock IDs) Lock(lockState State) IDs

func (IDs) LockState

func (lock IDs) LockState() State

func (*IDs) Match

func (lock *IDs) Match(lockState State, txIDs set.Set[ids.ID]) bool

func (IDs) Unlock

func (lock IDs) Unlock(lockState State) IDs

type In

type In struct {
	IDs                 `serialize:"true" json:"lockIDs"`
	avax.TransferableIn `serialize:"true" json:"input"`
}

func (*In) Equal

func (in *In) Equal(to any) bool

Used in vms/platformvm/txs/executor/camino_tx_executor.go func inputsAreEqual

func (*In) Verify

func (in *In) Verify() error

type Out

type Out struct {
	IDs                  `serialize:"true" json:"lockIDs"`
	avax.TransferableOut `serialize:"true" json:"output"`
}

func (*Out) Addresses

func (out *Out) Addresses() [][]byte

func (*Out) Equal

func (out *Out) Equal(to any) bool

Used in vms/platformvm/txs/executor/camino_tx_executor.go func outputsAreEqual

func (*Out) Verify

func (out *Out) Verify() error

type State

type State byte
const (
	StateUnlocked        State = 0b00
	StateDeposited       State = 0b01
	StateBonded          State = 0b10
	StateDepositedBonded State = 0b11
)

func (State) IsBonded

func (ls State) IsBonded() bool

func (State) IsDeposited

func (ls State) IsDeposited() bool

func (State) IsDepositedBonded

func (ls State) IsDepositedBonded() bool

func (State) String

func (ls State) String() string

func (State) Verify

func (ls State) Verify() error

Jump to

Keyboard shortcuts

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