Versions in this module Expand all Collapse all v0 v0.0.2 Aug 3, 2018 Changes in this version + var ErrInvalidFromAddress = errors.New("from address is not valid") + var ErrNilBlock = errors.New("block is nil") + var ErrNilDiff = errors.New("diff is nil") + var ErrNilTx = errors.New("transaction is nil") + var ErrNoHash = errors.New("no hash present") + var ErrNoSig = errors.New("no signature present") + func BuildBlockCoderFromBytes(data []byte) (*coder.StatechainBlock, error) + func BuildBytesCoderFromBytes(data []byte) (*coder.Diff, error) + func BuildCoderFromBlock(b *Block) *coder.StatechainBlock + func BuildCoderFromDiff(d *Diff) *coder.Diff + func BuildCoderFromTransaction(tx *Transaction) (*coder.Transaction, error) + func BuildTransactionCoderFromBytes(data []byte) (*coder.Transaction, error) + type Block struct + func New(props *BlockProps) *Block + func (b *Block) Deserialize(data []byte) error + func (b *Block) DeserializeString(hexStr string) error + func (b *Block) MarshalJSON() ([]byte, error) + func (b *Block) Serialize() ([]byte, error) + func (b *Block) SetHash() error + func (b *Block) UnmarshalJSON(data []byte) error + func (b Block) CalculateHash() (string, error) + func (b Block) CalculateHashBytes() ([]byte, error) + func (b Block) Equals(other merkletree.Content) (bool, error) + func (b Block) Props() BlockProps + func (b Block) SerializeString() (string, error) + type BlockProps struct + BlockHash *string + BlockNumber string + BlockTime string + ImageHash string + PrevBlockHash string + StateCurrentHash string + StatePrevDiffHash string + TxHash string + func BuildBlockPropsFromBytes(data []byte) (*BlockProps, error) + func BuildBlockPropsFromCoder(tmp *coder.StatechainBlock) (*BlockProps, error) + type Diff struct + func NewDiff(props *DiffProps) *Diff + func (d *Diff) Deserialize(data []byte) error + func (d *Diff) DeserializeString(hexStr string) error + func (d *Diff) MarshalJSON() ([]byte, error) + func (d *Diff) Serialize() ([]byte, error) + func (d *Diff) SetHash() error + func (d *Diff) UnmarshalJSON(data []byte) error + func (d Diff) CalculateHash() (string, error) + func (d Diff) CalculateHashBytes() ([]byte, error) + func (d Diff) Equals(other merkletree.Content) (bool, error) + func (d Diff) Props() DiffProps + func (d Diff) SerializeString() (string, error) + type DiffProps struct + Data string + DiffHash *string + func BuildDiffPropsFromBytes(data []byte) (*DiffProps, error) + func BuildDiffPropsFromCoder(tmp *coder.Diff) (*DiffProps, error) + type Transaction struct + func NewTransaction(props *TransactionProps) *Transaction + func (tx *Transaction) CalcSig(priv *ecdsa.PrivateKey) (*TxSig, error) + func (tx *Transaction) CalculateHash() (string, error) + func (tx *Transaction) CalculateHashBytes() ([]byte, error) + func (tx *Transaction) Deserialize(data []byte) error + func (tx *Transaction) DeserializeString(hexStr string) error + func (tx *Transaction) Equals(other merkletree.Content) (bool, error) + func (tx *Transaction) MarshalJSON() ([]byte, error) + func (tx *Transaction) Props() TransactionProps + func (tx *Transaction) Serialize() ([]byte, error) + func (tx *Transaction) SerializeString() (string, error) + func (tx *Transaction) SetHash() error + func (tx *Transaction) SetSig(priv *ecdsa.PrivateKey) error + func (tx *Transaction) UnmarshalJSON(data []byte) error + type TransactionProps struct + From string + ImageHash string + Method string + Payload []byte + Sig *TxSig + TxHash *string + func BuildTransactionPropsFromBytes(data []byte) (*TransactionProps, error) + func BuildTransactionPropsFromCoder(tmp *coder.Transaction) (*TransactionProps, error) + type TransactionsMap map[string][]*Transaction + type TxSig struct + R string + S string