Documentation ¶
Index ¶
- Constants
- Variables
- func InitLedgerState(par InitLedgerStateParams) common.VCommitment
- func PathToString(path []byte) string
- type InitLedgerStateParams
- type Readable
- type Transaction
- func (tx *Transaction) EssenceBytes() []byte
- func (tx *Transaction) MustForEachEndorsement(fun func(idx byte, txid ledger.TransactionID) bool)
- func (tx *Transaction) MustForEachInput(fun func(i byte, oid *ledger.OutputID) bool)
- func (tx *Transaction) NumInputs() int
- func (tx *Transaction) NumProducedOutputs() int
- func (tx *Transaction) OutputAt(idx byte) []byte
- func (tx *Transaction) SenderAddress() constraints.AddressED25519
- func (tx *Transaction) Timestamp() uint32
- type TransactionContext
- func TransactionContextFromTransaction(tx *Transaction, txid *ledger.TransactionID, ledgerState ledger.StateReader, ...) (*TransactionContext, error)
- func TransactionContextFromTransferableBytes(txBytes []byte, ledgerState ledger.StateReader, traceOption ...int) (*TransactionContext, error)
- func TransactionContextFromTransferableBytesWithTxID(txBytes []byte, txid *ledger.TransactionID, ledgerState ledger.StateReader, ...) (*TransactionContext, error)
- func (v *TransactionContext) ConsumedOutputData(idx byte) []byte
- func (v *TransactionContext) ForEachInputID(fun func(idx byte, oid *ledger.OutputID) bool)
- func (v *TransactionContext) InputCommitment() []byte
- func (v *TransactionContext) InputID(idx byte) ledger.OutputID
- func (v *TransactionContext) NumInputs() int
- func (v *TransactionContext) NumProducedOutputs() int
- func (v *TransactionContext) ProducedOutputData(idx byte) []byte
- func (v *TransactionContext) Signature() []byte
- func (v *TransactionContext) TimestampData() ([]byte, uint32)
- func (v *TransactionContext) TransactionBytes() []byte
- func (v *TransactionContext) TransactionID() *ledger.TransactionID
- func (v *TransactionContext) UnlockData(idx byte) []byte
- func (v *TransactionContext) UnlockParams(consumedOutputIdx, constraintIdx byte) []byte
- func (v *TransactionContext) Validate() ([]*indexer.Command, error)
- type Updatable
Constants ¶
const ( TraceOptionNone = iota TraceOptionAll TraceOptionFailedConstraints )
Variables ¶
var Path = lazyslice.Path
Functions ¶
func InitLedgerState ¶
func InitLedgerState(par InitLedgerStateParams) common.VCommitment
InitLedgerState initializes origin ledger state in the empty store If FinalityGadgetAddress != nil, it also creates chain output for the finality gadget Returns root commitment to the genesis ledger state
func PathToString ¶
Types ¶
type InitLedgerStateParams ¶
type InitLedgerStateParams struct { Store common.KVWriter Identity []byte InitialSupply uint64 GenesisAddress constraints.AddressED25519 Timestamp uint32 FinalityGadgetAddress constraints.AddressED25519 // FG output is created when not nil }
type Readable ¶
type Readable struct {
// contains filtered or unexported fields
}
Readable is a read-only ledger state, with the particular root
func NewReadable ¶
func NewReadable(store common.KVReader, root common.VCommitment, clearCacheAtSize ...int) (*Readable, error)
NewReadable creates read-only ledger state with the given root
func (*Readable) HasTransactionOutputs ¶
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
Transaction provides access to the tree of transferable transaction
func TransactionFromTransferableBytes ¶
func TransactionFromTransferableBytes(txBytes []byte, timestampBoundsInclusive ...uint32) (*Transaction, error)
func (*Transaction) EssenceBytes ¶
func (tx *Transaction) EssenceBytes() []byte
func (*Transaction) MustForEachEndorsement ¶
func (tx *Transaction) MustForEachEndorsement(fun func(idx byte, txid ledger.TransactionID) bool)
func (*Transaction) MustForEachInput ¶
func (tx *Transaction) MustForEachInput(fun func(i byte, oid *ledger.OutputID) bool)
func (*Transaction) NumInputs ¶
func (tx *Transaction) NumInputs() int
func (*Transaction) NumProducedOutputs ¶
func (tx *Transaction) NumProducedOutputs() int
func (*Transaction) OutputAt ¶
func (tx *Transaction) OutputAt(idx byte) []byte
func (*Transaction) SenderAddress ¶
func (tx *Transaction) SenderAddress() constraints.AddressED25519
func (*Transaction) Timestamp ¶
func (tx *Transaction) Timestamp() uint32
type TransactionContext ¶
type TransactionContext struct {
// contains filtered or unexported fields
}
TransactionContext is a data structure, which contains transferable transaction, consumed outputs and constraint library
func TransactionContextFromTransaction ¶
func TransactionContextFromTransaction(tx *Transaction, txid *ledger.TransactionID, ledgerState ledger.StateReader, traceOption ...int) (*TransactionContext, error)
func TransactionContextFromTransferableBytes ¶
func TransactionContextFromTransferableBytes(txBytes []byte, ledgerState ledger.StateReader, traceOption ...int) (*TransactionContext, error)
TransactionContextFromTransferableBytes constructs lazytree from transaction bytes and consumed outputs
func TransactionContextFromTransferableBytesWithTxID ¶
func TransactionContextFromTransferableBytesWithTxID(txBytes []byte, txid *ledger.TransactionID, ledgerState ledger.StateReader, traceOption ...int) (*TransactionContext, error)
func (*TransactionContext) ConsumedOutputData ¶
func (v *TransactionContext) ConsumedOutputData(idx byte) []byte
func (*TransactionContext) ForEachInputID ¶
func (v *TransactionContext) ForEachInputID(fun func(idx byte, oid *ledger.OutputID) bool)
func (*TransactionContext) InputCommitment ¶
func (v *TransactionContext) InputCommitment() []byte
func (*TransactionContext) NumInputs ¶
func (v *TransactionContext) NumInputs() int
func (*TransactionContext) NumProducedOutputs ¶
func (v *TransactionContext) NumProducedOutputs() int
func (*TransactionContext) ProducedOutputData ¶
func (v *TransactionContext) ProducedOutputData(idx byte) []byte
func (*TransactionContext) Signature ¶
func (v *TransactionContext) Signature() []byte
func (*TransactionContext) TimestampData ¶
func (v *TransactionContext) TimestampData() ([]byte, uint32)
func (*TransactionContext) TransactionBytes ¶
func (v *TransactionContext) TransactionBytes() []byte
func (*TransactionContext) TransactionID ¶
func (v *TransactionContext) TransactionID() *ledger.TransactionID
func (*TransactionContext) UnlockData ¶
func (v *TransactionContext) UnlockData(idx byte) []byte
func (*TransactionContext) UnlockParams ¶
func (v *TransactionContext) UnlockParams(consumedOutputIdx, constraintIdx byte) []byte
type Updatable ¶
type Updatable struct {
// contains filtered or unexported fields
}
Updatable is an updatable ledger state, with the particular root Suitable for chained updates
func NewUpdatable ¶
func NewUpdatable(store ledger.StateStore, root common.VCommitment) (*Updatable, error)
NewUpdatable creates updatable state with the given root. After updated, the root changes. Suitable for chained updates of the ledger state