Documentation ¶
Index ¶
- Constants
- Variables
- func CompileLocalLibrary(source string) ([]byte, error)
- func Equal(l1, l2 Constraint) bool
- func MinimumStorageDeposit(outputByteSize, extraWeight uint32) uint64
- func NameByPrefix(prefix []byte) (string, bool)
- func NewChainLockUnlockParams(chainOutputIndex, chainConstraintIndex byte) []byte
- type AccountID
- type Accountable
- type AddressED25519
- func (a AddressED25519) AccountID() AccountID
- func (a AddressED25519) AsLock() Lock
- func (a AddressED25519) Bytes() []byte
- func (a AddressED25519) IndexableTags() []Accountable
- func (a AddressED25519) Name() string
- func (a AddressED25519) String() string
- func (a AddressED25519) UnlockableWith(acc AccountID, ts uint32) bool
- type Amount
- type ChainConstraint
- type ChainLock
- func (cl ChainLock) AccountID() AccountID
- func (cl ChainLock) AsLock() Lock
- func (cl ChainLock) Bytes() []byte
- func (cl ChainLock) ChainID() []byte
- func (cl ChainLock) IndexableTags() []Accountable
- func (cl ChainLock) Name() string
- func (cl ChainLock) String() string
- func (cl ChainLock) UnlockableWith(acc AccountID, _ uint32) bool
- type CommitToSibling
- type Constraint
- type DataContext
- type DeadlineLock
- type GeneralScript
- type Immutable
- type Lock
- type Parser
- type RoyaltiesED25519
- type SenderAddressED25519
- type StateIndex
- type Timelock
- type Timestamp
Constants ¶
View Source
const ( TransactionBranch = byte(iota) ConsumedBranch )
Top level branches
View Source
const ( TxUnlockParams = byte(iota) TxInputIDs TxOutputs TxSignature TxTimestamp TxInputCommitment TxEndorsements TxLocalLibraries TxTreeIndexMax )
Transaction tree
View Source
const ( ConstraintIndexAmount = byte(iota) ConstraintIndexTimestamp ConstraintIndexLock )
Mandatory output block indices
View Source
const AddressED25519ConstraintSource = `` /* 2112-byte string literal not displayed */
View Source
const (
AmountConstraintName = "amount"
)
View Source
const (
ChainConstraintName = "chain"
)
View Source
const ChainLockConstraintSource = `` /* 905-byte string literal not displayed */
View Source
const (
ChainLockName = "chainLock"
)
View Source
const (
CommitToSiblingName = "commitToSibling"
)
View Source
const CommitToSiblingSource = `` /* 337-byte string literal not displayed */
View Source
const (
ConsumedOutputsBranch = byte(iota)
)
View Source
const ImmutableDataSource = `` /* 1968-byte string literal not displayed */
View Source
const (
ImmutableName = "immutable"
)
View Source
const MaxNumberOfEndorsements = 4
MaxNumberOfEndorsements is equivalent to 2 parents in the original Tangle. Here it can be any number from 0 to MaxNumberOfEndorsements inclusive
View Source
const (
RoyaltiesED25519Name = "royaltiesED25519"
)
View Source
const RoyaltiesED25519Source = `` /* 625-byte string literal not displayed */
View Source
const (
SenderAddressED25519Name = "senderAddressED25519"
)
View Source
const (
StateIndexName = "stateIndex"
)
View Source
const StateIndexSource = `
func stateIndex : concat($0, $1, !!!implement_me_StateIndexConstraint)
`
View Source
const (
TimestampConstraintName = "timestamp"
)
Variables ¶
View Source
var ( PathToConsumedOutputs = lazyslice.Path(ConsumedBranch, ConsumedOutputsBranch) PathToProducedOutputs = lazyslice.Path(TransactionBranch, TxOutputs) PathToUnlockParams = lazyslice.Path(TransactionBranch, TxUnlockParams) PathToInputIDs = lazyslice.Path(TransactionBranch, TxInputIDs) PathToSignature = lazyslice.Path(TransactionBranch, TxSignature) PathToInputCommitment = lazyslice.Path(TransactionBranch, TxInputCommitment) PathToEndorsements = lazyslice.Path(TransactionBranch, TxEndorsements) PathToLocalLibraries = lazyslice.Path(TransactionBranch, TxLocalLibraries) PathToTimestamp = lazyslice.Path(TransactionBranch, TxTimestamp) )
Functions ¶
func CompileLocalLibrary ¶
CompileLocalLibrary compiles local library and serializes it as lazy array
func Equal ¶
func Equal(l1, l2 Constraint) bool
func MinimumStorageDeposit ¶
func NameByPrefix ¶
Types ¶
type Accountable ¶
type Accountable interface { Constraint AccountID() AccountID AsLock() Lock }
func AccountableFromBytes ¶
func AccountableFromBytes(data []byte) (Accountable, error)
type AddressED25519 ¶
type AddressED25519 []byte
func AddressED25519FromBytes ¶
func AddressED25519FromBytes(data []byte) (AddressED25519, error)
func AddressED25519FromPrivateKey ¶
func AddressED25519FromPrivateKey(privateKey ed25519.PrivateKey) AddressED25519
func AddressED25519FromPublicKey ¶
func AddressED25519FromPublicKey(pubKey ed25519.PublicKey) AddressED25519
func AddressED25519Null ¶
func AddressED25519Null() AddressED25519
func (AddressED25519) AccountID ¶
func (a AddressED25519) AccountID() AccountID
func (AddressED25519) AsLock ¶
func (a AddressED25519) AsLock() Lock
func (AddressED25519) Bytes ¶
func (a AddressED25519) Bytes() []byte
func (AddressED25519) IndexableTags ¶
func (a AddressED25519) IndexableTags() []Accountable
func (AddressED25519) Name ¶
func (a AddressED25519) Name() string
func (AddressED25519) String ¶
func (a AddressED25519) String() string
func (AddressED25519) UnlockableWith ¶
func (a AddressED25519) UnlockableWith(acc AccountID, ts uint32) bool
type ChainConstraint ¶
type ChainConstraint struct { // ID all-0 for origin ID [32]byte TransitionMode byte // Previous index of the consumed chain input with the same ID. Must be 0xFF for the origin PreviousOutput byte PreviousBlock byte }
ChainConstraint is a chain constraint
func ChainConstraintFromBytes ¶
func ChainConstraintFromBytes(data []byte) (*ChainConstraint, error)
func NewChainConstraint ¶
func NewChainConstraint(id [32]byte, prevOut, prevBlock, mode byte) *ChainConstraint
func NewChainOrigin ¶
func NewChainOrigin() *ChainConstraint
func (*ChainConstraint) Bytes ¶
func (ch *ChainConstraint) Bytes() []byte
func (*ChainConstraint) ChainLock ¶
func (ch *ChainConstraint) ChainLock() ChainLock
func (*ChainConstraint) IsOrigin ¶
func (ch *ChainConstraint) IsOrigin() bool
func (*ChainConstraint) Name ¶
func (ch *ChainConstraint) Name() string
func (*ChainConstraint) String ¶
func (ch *ChainConstraint) String() string
type ChainLock ¶
type ChainLock []byte
func ChainLockFromBytes ¶
func ChainLockFromChainID ¶
func ChainLockNull ¶
func ChainLockNull() ChainLock
func (ChainLock) IndexableTags ¶
func (cl ChainLock) IndexableTags() []Accountable
type CommitToSibling ¶
func CommitToSiblingFromBytes ¶
func CommitToSiblingFromBytes(data []byte) (*CommitToSibling, error)
func NewCommitToSibling ¶
func NewCommitToSibling(siblingIndex byte, siblingHash []byte) *CommitToSibling
func (*CommitToSibling) Bytes ¶
func (cs *CommitToSibling) Bytes() []byte
func (*CommitToSibling) Name ¶
func (cs *CommitToSibling) Name() string
func (*CommitToSibling) String ¶
func (cs *CommitToSibling) String() string
type Constraint ¶
func FromBytes ¶
func FromBytes(data []byte) (Constraint, error)
type DataContext ¶
type DataContext struct {
// contains filtered or unexported fields
}
DataContext is the data structure passed to the eval call. It contains: - tree: all validation context of the transaction, all data which is to be validated - path: a path in the validation context of the constraint being validated in the eval call
func NewDataContext ¶
func NewDataContext(tree *lazyslice.Tree) *DataContext
func (*DataContext) DataTree ¶
func (c *DataContext) DataTree() *lazyslice.Tree
func (*DataContext) Path ¶
func (c *DataContext) Path() lazyslice.TreePath
func (*DataContext) SetPath ¶
func (c *DataContext) SetPath(path lazyslice.TreePath)
type DeadlineLock ¶
type DeadlineLock struct { Deadline uint32 ConstraintMain Accountable ConstraintExpiry Accountable }
func DeadlineLockFromBytes ¶
func DeadlineLockFromBytes(data []byte) (*DeadlineLock, error)
func NewDeadlineLock ¶
func NewDeadlineLock(deadline uint32, main, expiry Accountable) *DeadlineLock
func (*DeadlineLock) Bytes ¶
func (dl *DeadlineLock) Bytes() []byte
func (*DeadlineLock) IndexableTags ¶
func (dl *DeadlineLock) IndexableTags() []Accountable
func (*DeadlineLock) Name ¶
func (dl *DeadlineLock) Name() string
func (*DeadlineLock) String ¶
func (dl *DeadlineLock) String() string
func (*DeadlineLock) UnlockableWith ¶
func (dl *DeadlineLock) UnlockableWith(acc AccountID, ts uint32) bool
type GeneralScript ¶
type GeneralScript []byte
func NewGeneralScript ¶
func NewGeneralScript(data []byte) GeneralScript
func NewGeneralScriptFromSource ¶
func NewGeneralScriptFromSource(src string) (GeneralScript, error)
func (GeneralScript) Bytes ¶
func (u GeneralScript) Bytes() []byte
func (GeneralScript) Name ¶
func (u GeneralScript) Name() string
func (GeneralScript) String ¶
func (u GeneralScript) String() string
type Lock ¶
type Lock interface { Constraint IndexableTags() []Accountable UnlockableWith(acc AccountID, ts uint32) bool }
func LockFromBytes ¶
type Parser ¶
type Parser func([]byte) (Constraint, error)
type RoyaltiesED25519 ¶
type RoyaltiesED25519 struct { Address AddressED25519 Amount uint64 }
func NewRoyalties ¶
func NewRoyalties(addr AddressED25519, amount uint64) *RoyaltiesED25519
func RoyaltiesED25519FromBytes ¶
func RoyaltiesED25519FromBytes(data []byte) (*RoyaltiesED25519, error)
func (*RoyaltiesED25519) Bytes ¶
func (cl *RoyaltiesED25519) Bytes() []byte
func (*RoyaltiesED25519) Name ¶
func (cl *RoyaltiesED25519) Name() string
func (RoyaltiesED25519) String ¶
func (cl RoyaltiesED25519) String() string
type SenderAddressED25519 ¶
type SenderAddressED25519 struct {
Address AddressED25519
}
func NewSenderAddressED25519 ¶
func NewSenderAddressED25519(addr AddressED25519) *SenderAddressED25519
func SenderAddressED25519FromBytes ¶
func SenderAddressED25519FromBytes(data []byte) (*SenderAddressED25519, error)
func (*SenderAddressED25519) Bytes ¶
func (s *SenderAddressED25519) Bytes() []byte
func (*SenderAddressED25519) Name ¶
func (s *SenderAddressED25519) Name() string
func (*SenderAddressED25519) String ¶
func (s *SenderAddressED25519) String() string
type StateIndex ¶
func NewStateIndex ¶
func NewStateIndex(chainBlockIndex byte, stateIndex uint32) *StateIndex
func StateIndexFromBytes ¶
func StateIndexFromBytes(data []byte) (*StateIndex, error)
func (*StateIndex) Bytes ¶
func (s *StateIndex) Bytes() []byte
func (*StateIndex) Name ¶
func (_ *StateIndex) Name() string
func (*StateIndex) String ¶
func (s *StateIndex) String() string
Click to show internal directories.
Click to hide internal directories.