Ledger
An append-only record of contract state changes.
Usage
Ledger()Declares a type alias in its own body, which belongs under a “Type Aliases” heading of its own rather than being dropped.
Type Aliases
| Name | Description |
|---|---|
| Entry | A single ledger entry: which contract, and where it applies |
Entry
A single ledger entry: which contract, and where it applies
type Entry = tuple[ContractId, Jurisdiction]
Attributes
| Name | Description |
|---|---|
| max_entries | How many entries the ledger retains before rotating |
max_entries
How many entries the ledger retains before rotating
max_entries: int = 1000
Methods
| Name | Description |
|---|---|
| append() |
Record that contract_id applies in where.
|
| entries() | Every recorded entry, oldest first. |
append()
Record that contract_id applies in where.
Usage
append(contract_id, where)Parameters
contract_id: ContractId-
The contract being recorded.
where: Jurisdiction-
The jurisdiction it applies in.
entries()
Every recorded entry, oldest first.
Usage
entries()Returns
list-
The entries in insertion order.