Documentation ¶
Index ¶
- Variables
- func HashOfInt(in uint64) indexedhashes.Sha256
- func TestBlock2Trans2_helper(blockchain chainreadinterface.IBlockChain, t *testing.T)
- func TestGenesisBlock_helper(blockchain chainreadinterface.IBlockChain, t *testing.T)
- func TestGenesisHandle_helper(blockchain chainreadinterface.IBlockChain, t *testing.T)
- func TestGenesisNextParent_helper(blockchain chainreadinterface.IBlockChain, t *testing.T)
- func TestGenesisParentInvalid_helper(blockchain chainreadinterface.IBlockChain, t *testing.T)
- func TestGenesisTransaction_helper(blockchain chainreadinterface.IBlockChain, t *testing.T)
- func TestHashEquality_helper(hBlock0 chainreadinterface.IBlockHandle, ...)
- func TestInvalidHandle_helper(blockchain chainreadinterface.IBlockChain, t *testing.T)
- func TestLatestBlockNotGenesis_helper(blockchain chainreadinterface.IBlockChain, t *testing.T)
- func TestLatestNextBlock_helper(blockchain chainreadinterface.IBlockChain, t *testing.T)
- func TestLatestNextTransaction_helper(blockchain chainreadinterface.IBlockChain, t *testing.T)
- func TestLatestPrevNextBlock_helper(blockchain chainreadinterface.IBlockChain, t *testing.T)
- func TestThirdTransaction_helper(blockchain chainreadinterface.IBlockChain, t *testing.T)
- func TestTransaction_helper(blockchain chainreadinterface.IBlockChain, t *testing.T)
- type Block
- type BlockHandle
- type Blockchain
- func (bc *Blockchain) AddressInterface(addr chainreadinterface.IAddressHandle) (chainreadinterface.IAddress, error)
- func (bc *Blockchain) BlockInterface(b chainreadinterface.IBlockHandle) (chainreadinterface.IBlock, error)
- func (bc *Blockchain) GenesisBlock() chainreadinterface.IBlockHandle
- func (bc *Blockchain) GenesisTransaction() (chainreadinterface.ITransHandle, error)
- func (bc *Blockchain) InvalidBlock() chainreadinterface.IBlockHandle
- func (bc *Blockchain) InvalidTrans() chainreadinterface.ITransHandle
- func (bc *Blockchain) IsBlockTree() bool
- func (bc *Blockchain) LatestBlock() (chainreadinterface.IBlockHandle, error)
- func (bc *Blockchain) LatestTransaction() (chainreadinterface.ITransHandle, error)
- func (bc *Blockchain) NextBlock(handle chainreadinterface.IBlockHandle) (chainreadinterface.IBlockHandle, error)
- func (bc *Blockchain) NextTransaction(t chainreadinterface.ITransHandle) (chainreadinterface.ITransHandle, error)
- func (bc *Blockchain) ParentBlock(b chainreadinterface.IBlockHandle) chainreadinterface.IBlockHandle
- func (bc *Blockchain) PreviousTransaction(t chainreadinterface.ITransHandle) chainreadinterface.ITransHandle
- func (bc *Blockchain) TransInterface(t chainreadinterface.ITransHandle) (chainreadinterface.ITransaction, error)
- func (bc *Blockchain) TxiInterface(txi chainreadinterface.ITxiHandle) (chainreadinterface.ITxi, error)
- func (bc *Blockchain) TxoInterface(txo chainreadinterface.ITxoHandle) (chainreadinterface.ITxo, error)
- type HashHeight
- type TransHandle
- type TransIndex
- type Transaction
- func (t *Transaction) NonEssentialInts() (*map[string]int64, error)
- func (t *Transaction) NthTxi(n int64) (chainreadinterface.ITxiHandle, error)
- func (t *Transaction) NthTxo(n int64) (chainreadinterface.ITxoHandle, error)
- func (t *Transaction) TxiCount() (int64, error)
- func (t *Transaction) TxoCount() (int64, error)
- type Txi
- type TxiHandle
- func (th *TxiHandle) IndicesPath() (int64, int64, int64)
- func (th *TxiHandle) IndicesPathSpecified() bool
- func (txi *TxiHandle) ParentIndex() int64
- func (txi *TxiHandle) ParentSpecified() bool
- func (txi *TxiHandle) ParentTrans() chainreadinterface.ITransHandle
- func (txi *TxiHandle) TxiHeight() int64
- func (th *TxiHandle) TxiHeightSpecified() bool
- type Txo
- type TxoHandle
- func (txo *TxoHandle) IndicesPath() (int64, int64, int64)
- func (txo *TxoHandle) IndicesPathSpecified() bool
- func (txo *TxoHandle) ParentIndex() int64
- func (txo *TxoHandle) ParentSpecified() bool
- func (txo *TxoHandle) ParentTrans() chainreadinterface.ITransHandle
- func (txo *TxoHandle) TxoHeight() int64
- func (txo *TxoHandle) TxoHeightSpecified() bool
- type TxxHandle
Constants ¶
This section is empty.
Variables ¶
View Source
var TheTinyChain = (chainreadinterface.IBlockChain)(&theTinyChain)
Access to the top level interface to the chain
Functions ¶
func HashOfInt ¶
func HashOfInt(in uint64) indexedhashes.Sha256
func TestBlock2Trans2_helper ¶
func TestBlock2Trans2_helper(blockchain chainreadinterface.IBlockChain, t *testing.T)
func TestGenesisBlock_helper ¶
func TestGenesisBlock_helper(blockchain chainreadinterface.IBlockChain, t *testing.T)
func TestGenesisHandle_helper ¶
func TestGenesisHandle_helper(blockchain chainreadinterface.IBlockChain, t *testing.T)
func TestGenesisNextParent_helper ¶
func TestGenesisNextParent_helper(blockchain chainreadinterface.IBlockChain, t *testing.T)
func TestGenesisParentInvalid_helper ¶
func TestGenesisParentInvalid_helper(blockchain chainreadinterface.IBlockChain, t *testing.T)
func TestGenesisTransaction_helper ¶
func TestGenesisTransaction_helper(blockchain chainreadinterface.IBlockChain, t *testing.T)
func TestHashEquality_helper ¶
func TestHashEquality_helper(hBlock0 chainreadinterface.IBlockHandle, hBlock00 chainreadinterface.IBlockHandle, hBlock1 chainreadinterface.IBlockHandle, t *testing.T)
func TestInvalidHandle_helper ¶
func TestInvalidHandle_helper(blockchain chainreadinterface.IBlockChain, t *testing.T)
func TestLatestBlockNotGenesis_helper ¶
func TestLatestBlockNotGenesis_helper(blockchain chainreadinterface.IBlockChain, t *testing.T)
func TestLatestNextBlock_helper ¶
func TestLatestNextBlock_helper(blockchain chainreadinterface.IBlockChain, t *testing.T)
func TestLatestNextTransaction_helper ¶
func TestLatestNextTransaction_helper(blockchain chainreadinterface.IBlockChain, t *testing.T)
func TestLatestPrevNextBlock_helper ¶
func TestLatestPrevNextBlock_helper(blockchain chainreadinterface.IBlockChain, t *testing.T)
func TestThirdTransaction_helper ¶
func TestThirdTransaction_helper(blockchain chainreadinterface.IBlockChain, t *testing.T)
func TestTransaction_helper ¶
func TestTransaction_helper(blockchain chainreadinterface.IBlockChain, t *testing.T)
Types ¶
type Block ¶
type Block struct { BlockHandle // contains filtered or unexported fields }
func (*Block) NthTransaction ¶
func (b *Block) NthTransaction(n int64) (chainreadinterface.ITransHandle, error)
func (*Block) TransactionCount ¶
type BlockHandle ¶
type BlockHandle struct {
HashHeight
}
BlockHandle implements IBlockHandle
func (*BlockHandle) IsBlockHandle ¶
func (bh *BlockHandle) IsBlockHandle()
func (*BlockHandle) IsInvalid ¶
func (bh *BlockHandle) IsInvalid() bool
type Blockchain ¶
type Blockchain struct {
// contains filtered or unexported fields
}
Blockchain implements IBlockchain (and so implicitly IBlockTree)
func (*Blockchain) AddressInterface ¶
func (bc *Blockchain) AddressInterface(addr chainreadinterface.IAddressHandle) (chainreadinterface.IAddress, error)
func (*Blockchain) BlockInterface ¶
func (bc *Blockchain) BlockInterface(b chainreadinterface.IBlockHandle) (chainreadinterface.IBlock, error)
func (*Blockchain) GenesisBlock ¶
func (bc *Blockchain) GenesisBlock() chainreadinterface.IBlockHandle
func (*Blockchain) GenesisTransaction ¶
func (bc *Blockchain) GenesisTransaction() (chainreadinterface.ITransHandle, error)
func (*Blockchain) InvalidBlock ¶
func (bc *Blockchain) InvalidBlock() chainreadinterface.IBlockHandle
func (*Blockchain) InvalidTrans ¶
func (bc *Blockchain) InvalidTrans() chainreadinterface.ITransHandle
func (*Blockchain) IsBlockTree ¶
func (bc *Blockchain) IsBlockTree() bool
func (*Blockchain) LatestBlock ¶
func (bc *Blockchain) LatestBlock() (chainreadinterface.IBlockHandle, error)
Implement the rest of IBlockChain
func (*Blockchain) LatestTransaction ¶
func (bc *Blockchain) LatestTransaction() (chainreadinterface.ITransHandle, error)
func (*Blockchain) NextBlock ¶
func (bc *Blockchain) NextBlock(handle chainreadinterface.IBlockHandle) (chainreadinterface.IBlockHandle, error)
func (*Blockchain) NextTransaction ¶
func (bc *Blockchain) NextTransaction(t chainreadinterface.ITransHandle) (chainreadinterface.ITransHandle, error)
func (*Blockchain) ParentBlock ¶
func (bc *Blockchain) ParentBlock(b chainreadinterface.IBlockHandle) chainreadinterface.IBlockHandle
func (*Blockchain) PreviousTransaction ¶
func (bc *Blockchain) PreviousTransaction(t chainreadinterface.ITransHandle) chainreadinterface.ITransHandle
func (*Blockchain) TransInterface ¶
func (bc *Blockchain) TransInterface(t chainreadinterface.ITransHandle) (chainreadinterface.ITransaction, error)
func (*Blockchain) TxiInterface ¶
func (bc *Blockchain) TxiInterface(txi chainreadinterface.ITxiHandle) (chainreadinterface.ITxi, error)
func (*Blockchain) TxoInterface ¶
func (bc *Blockchain) TxoInterface(txo chainreadinterface.ITxoHandle) (chainreadinterface.ITxo, error)
type HashHeight ¶
type HashHeight struct {
// contains filtered or unexported fields
}
A HashHeight for tinychain that doesn't store a hash The hash is merely the hash of the height number
func (*HashHeight) Hash ¶
func (hh *HashHeight) Hash() (indexedhashes.Sha256, error)
func (*HashHeight) HashSpecified ¶
func (hh *HashHeight) HashSpecified() bool
func (*HashHeight) Height ¶
func (hh *HashHeight) Height() int64
func (*HashHeight) HeightSpecified ¶
func (hh *HashHeight) HeightSpecified() bool
type TransHandle ¶
type TransHandle struct {
HashHeight
}
TransHandle implements ITransHandle
func (*TransHandle) IndicesPath ¶
func (th *TransHandle) IndicesPath() (int64, int64)
func (*TransHandle) IndicesPathSpecified ¶
func (th *TransHandle) IndicesPathSpecified() bool
func (*TransHandle) IsInvalid ¶
func (th *TransHandle) IsInvalid() bool
func (*TransHandle) IsTransHandle ¶
func (th *TransHandle) IsTransHandle()
type TransIndex ¶
type TransIndex struct { TransHandle // contains filtered or unexported fields }
A TransIndex for tinychain
type Transaction ¶
type Transaction struct { TransHandle // contains filtered or unexported fields }
Transaction implements ITransaction
func (*Transaction) NonEssentialInts ¶
func (t *Transaction) NonEssentialInts() (*map[string]int64, error)
func (*Transaction) NthTxi ¶
func (t *Transaction) NthTxi(n int64) (chainreadinterface.ITxiHandle, error)
func (*Transaction) NthTxo ¶
func (t *Transaction) NthTxo(n int64) (chainreadinterface.ITxoHandle, error)
func (*Transaction) TxiCount ¶
func (t *Transaction) TxiCount() (int64, error)
func (*Transaction) TxoCount ¶
func (t *Transaction) TxoCount() (int64, error)
type Txi ¶
type Txi struct { TxiHandle // contains filtered or unexported fields }
func (Txi) SourceTxo ¶
func (atxi Txi) SourceTxo() (chainreadinterface.ITxoHandle, error)
type TxiHandle ¶
type TxiHandle struct {
TxxHandle
}
func (*TxiHandle) IndicesPathSpecified ¶
func (*TxiHandle) ParentIndex ¶
func (*TxiHandle) ParentSpecified ¶
func (*TxiHandle) ParentTrans ¶
func (txi *TxiHandle) ParentTrans() chainreadinterface.ITransHandle
func (*TxiHandle) TxiHeightSpecified ¶
type Txo ¶
type Txo struct { TxoHandle // contains filtered or unexported fields }
A transaction output supporting the ITxo interface
func (Txo) Address ¶
func (txo Txo) Address() (chainreadinterface.IAddressHandle, error)
type TxoHandle ¶
type TxoHandle struct {
TxxHandle
}
func (*TxoHandle) IndicesPathSpecified ¶
func (*TxoHandle) ParentIndex ¶
func (*TxoHandle) ParentSpecified ¶
func (*TxoHandle) ParentTrans ¶
func (txo *TxoHandle) ParentTrans() chainreadinterface.ITransHandle
func (*TxoHandle) TxoHeightSpecified ¶
type TxxHandle ¶
type TxxHandle struct { TransIndex // contains filtered or unexported fields }
A TxxHandle for tinychain
Click to show internal directories.
Click to hide internal directories.