Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func NewEngine ¶
func NewEngine(handler EngineHandler) *Engine
func (*Engine) Submit ¶
func (engine *Engine) Submit(transaction *Transaction) error
type EngineHandler ¶
type EngineHandler interface { // Validate if output to consume and output to insert are sound with respect to the system Validate(transaction *Transaction, inputs []*Output, outputs []*Output) error // Request missing inputs. Transaction is provided to enqueue it again for evaluation once Input is retrieved Request(transaction *Transaction, input *Input) (*Output, error) // Transaction is submitted Submitted(inputs []*Output, outputs []*Output) }
type Output ¶
type Output struct { ID string Owner account.GenericAccount Payload []byte Signature []byte }
type OutputStorage ¶
func NewOutputStorage ¶
func NewOutputStorage() *OutputStorage
func (*OutputStorage) AddOutput ¶
func (storage *OutputStorage) AddOutput(output *Output) error
func (*OutputStorage) FindOutputFromInput ¶
func (storage *OutputStorage) FindOutputFromInput(input *Input) (*Output, error)
func (*OutputStorage) String ¶
func (storage *OutputStorage) String() string
type Transaction ¶
type Transaction struct { Account account.GenericAccount Inputs []*Input Outputs []*Output Signature []byte }
func NewTransactionFromBytes ¶
func NewTransactionFromBytes(data []byte) (*Transaction, error)
func (*Transaction) Deserialize ¶
func (transaction *Transaction) Deserialize(data []byte) error
func (*Transaction) Serialize ¶
func (transaction *Transaction) Serialize() ([]byte, error)
func (*Transaction) Verify ¶
func (t *Transaction) Verify() (bool, error)
Click to show internal directories.
Click to hide internal directories.