Documentation ¶
Index ¶
- func AppendTxOutputToTx(tx *TransactionType, txo *TxOutputType)
- func SerializeForSeal(tx *TransactionType) []byte
- func SerializeTransaction(tx *TransactionType) []byte
- func SerializeTransactionInput(buf *bytes.Buffer, inp *TxInputType)
- func SerializeTransactionOutput(buf *bytes.Buffer, out *TxOutputType)
- type TransactionType
- type TxInputType
- type TxOutputType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendTxOutputToTx ¶
func AppendTxOutputToTx(tx *TransactionType, txo *TxOutputType)
func SerializeForSeal ¶
func SerializeForSeal(tx *TransactionType) []byte
SearalizeForSeal searializes into bytes the fields that will be hashed for the mining seal.
func SerializeTransaction ¶
func SerializeTransaction(tx *TransactionType) []byte
SearalizeTransaction searializes into bytes the fields that will be hashed the hash of the block. This is the hash that the next block will use to point to this block and the hash that this block will be saved as.
func SerializeTransactionInput ¶
func SerializeTransactionInput(buf *bytes.Buffer, inp *TxInputType)
func SerializeTransactionOutput ¶
func SerializeTransactionOutput(buf *bytes.Buffer, out *TxOutputType)
Types ¶
type TransactionType ¶
type TransactionType struct { TxOffset int // The position of this in the block. Input []TxInputType // Set of inputs to a transaction Output []TxOutputType // Set of outputs to a tranaction SCOwnerAccount addr.AddressType // Used in HW 6 - Smart Contracts - Owner of Contract SCAddress addr.AddressType // Used in HW 6 - Smart Contracts - Address of Contract SCOutputData string // Used in HW 6 - Smart Contracts - Output data from contract Account addr.AddressType // Signature lib.SignatureType // Used in HW 5 - Signature that this is a valid tranaction for this account Message string // Used in HW 5 - Message (hash of original) that signature signs for Comment string // }
func NewEmptyTx ¶
func NewEmptyTx(memo string, passedAcct addr.AddressType) *TransactionType
type TxInputType ¶
type TxInputType struct { BlockNo int // Which block is this from TxOffset int // The transaction in the block. In the block[BlockHash].Tx[TxOffset] TxOutputPos int // Position of the output in the transaction. In the block[BlockHash].Tx[TxOffset].Output[TxOutptuPos] Amount int // Value }
func CreateTxInputsFromOldOutputs ¶
func CreateTxInputsFromOldOutputs(oldOutput []*TxOutputType) (txIn []TxInputType, err error)
type TxOutputType ¶
type TxOutputType struct { BlockNo int // Which block is this in TxOffset int // Which transaction in this block. block[this].Tx[TxOffset] TxOutputPos int // Position of the output in this block. In the block[this].Tx[TxOffset].Output[TxOutptuPos] Account addr.AddressType // Acctount funds go to (If this is ""chagne"" then this is the same as TransactionType.Account Amount int // Amoutn to go to accoutn }
func CreateTxOutputWithFunds ¶
func CreateTxOutputWithFunds(to addr.AddressType, amount int) (txo *TxOutputType, err error)
Click to show internal directories.
Click to hide internal directories.