Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

timelock state

Back to all declarations

StatePending

untyped string

// scheduled, not yet ready

Value

"Pending"

StateReady

untyped string

// ready height reached, awaiting execution

Value

"Ready"

StateExecuted

untyped string

// terminal

Value

"Executed"

StateCancelled

untyped string

// terminal

Value

"Cancelled"

Operation

type

Operation is a single scheduled action.

Value

timelock.Operation

nextID

int

Value

1

Schedule

func(action string, delayBlocks int) int

Schedule registers a new operation to run after delayBlocks blocks and returns its id. delayBlocks must be >= 0.

Open
OID
0d499e…5344:7
Schedule details

Inspect func

Execute

func(id int)

Execute runs a ready operation. It panics if the operation is unknown, already terminal, or not yet ready.

Open
OID
0d499e…5344:9
Execute details

Inspect func

Cancel

func(id int)

Cancel drops a pending or ready operation before it executes. It panics if the operation is unknown or already terminal.

Open
OID
0d499e…5344:10
Cancel details

Inspect func

mustGet

func(id int) *timelock.Operation

mustGet returns the operation or panics if absent.

Open
OID
0d499e…5344:11
mustGet details

Inspect func

paddedKey

func(id int) string

paddedKey returns a fixed-width, lexicographically sortable key for an id so avl iteration yields operations in id order.

Open
OID
0d499e…5344:12
paddedKey details

Inspect func

StateOf

func(op *timelock.Operation, height int64) string

StateOf returns the display state of op at the given chain height.

Open
OID
0d499e…5344:13
StateOf details

Inspect func

BlocksRemaining

func(op *timelock.Operation, height int64) int64

BlocksRemaining returns how many blocks remain before op is ready (0 if already ready or past).

Open
OID
0d499e…5344:14
BlocksRemaining details

Inspect func

Render

func(path string) string

Render implements the standard realm markdown view.

Open
OID
0d499e…5344:15
Render details

Inspect func
StatePending : untyped string ="Pending"
StateReady : untyped string ="Ready"
StateExecuted : untyped string ="Executed"
StateCancelled : untyped string ="Cancelled"
Operation : type =timelock.Operation
ops : *v0.Tree Inspect
nextID : int =1
Schedule : func(action string, delayBlocks int) int Inspect
Execute : func(id int) Inspect
Cancel : func(id int) Inspect
mustGet : func(id int) *timelock.Operation Inspect
paddedKey : func(id int) string Inspect
StateOf : func(op *timelock.Operation, height int64) string Inspect
BlocksRemaining : func(op *timelock.Operation, height int64) int64 Inspect
Render : func(path string) string Inspect