Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Output ¶
type Output struct {
Reference *StateReference
ID string // Unique Identifier of this Output
Raw []byte // Raw representation of the state
Birth Script // Birth script descriptor
Death Script // Death script descriptor
}
type Script ¶
type Script struct {
Type string // Unique identifier of this script
Raw []byte // Payload of the script. The content depends on the script's type.
}
Script models a UTXO script
type StateReference ¶
type StateReference struct {
TxID string // Transaction ID
Index uint64 // Output’s index in the transaction
}
StateReference models the index of an output
func (StateReference) String ¶
func (s StateReference) String() string
type StateValidator ¶
type StateValidator interface {
Validate(tx Transaction, index uint32) error
}
type Transaction ¶
type Transaction interface {
// ID returns the transaction's id
ID() string
// Inputs returns the inputs referenced by this transaction
Inputs() []*StateReference
// Outputs returns the outputs defined by this transaction
Outputs() []*Output
// NumInputs returns the number of inputs in this transaction
NumInputs() int
// NumOutputs returns the number of inputs in this transaction
NumOutputs() int
// GetInputAt retrieves the state referenced by the index-th input. In addition, it returns
// the worldstate reference to that state and the associated birth and death scripts
GetInputAt(index int, state interface{}) (*StateReference, *Scripts, error)
// GetInputScriptsAt returns the birth and death scripts associated to worldstate
// referenced by the index-th input
GetInputScriptsAt(index int) (*Scripts, error)
// GetOutputAt retrieves the state referenced by the index-th output. In addition, it returns
// the associated birth and death scripts
GetOutputAt(index int, state interface{}) (*Scripts, error)
// GetOutputScriptsAt returns the birth and death scripts associated to transaction's output
// referenced by the index-th input
GetOutputScriptsAt(index int) (*Scripts, error)
// HasBeenSignedBy returns nil if all the passed parties have endorsed this transaction
HasBeenSignedBy(parties ...view.Identity) error
// NumSignatures returns the number of signatures carried by this transaction
NumSignatures() int
}
Transaction provides a UTXO transaction abstraction
Click to show internal directories.
Click to hide internal directories.