Versions in this module Expand all Collapse all v1 v1.1.1 Oct 29, 2019 Changes in this version + var EmptyRootHash = DeriveSha(transaction.Transactions{}) + var ErrInvalidChainId = errors.New("invalid chain id for block signer") + var ErrInvalidSig = errors.New("invalid block v, r, s values") + func DeriveSha(list DerivableList) types.Hash + func Number(b1, b2 *Block) bool + func SignHeaderInner(h *Header, s Signer, prv *ecdsa.PrivateKey) error + type Block struct + B Body + H *Header + ReceivedAt time.Time + ReceivedFrom interface{} + func NewBlock(header *Header, txs []*transaction.Transaction, ...) *Block + func NewBlockWithHeader(header *Header) *Block + func (b *Block) Bloom() types.Bloom + func (b *Block) Body() *Body + func (b *Block) Hash() types.Hash + func (b *Block) HashNoSig() types.Hash + func (b *Block) Header() *Header + func (b *Block) Number() *big.Int + func (b *Block) NumberU64() uint64 + func (b *Block) ParentHash() types.Hash + func (b *Block) Producer() types.Address + func (b *Block) ReceiptHash() types.Hash + func (b *Block) Root() types.Hash + func (b *Block) Size() common.StorageSize + func (b *Block) String() string + func (b *Block) Time() *big.Int + func (b *Block) Transaction(hash types.Hash) *transaction.Transaction + func (b *Block) Transactions() transaction.Transactions + func (b *Block) TxHash() types.Hash + func (b *Block) WithBody(body *Body) *Block + func (b *Block) WithSeal(header *Header) *Block + func (z *Block) DecodeMsg(dc *msgp.Reader) (err error) + func (z *Block) EncodeMsg(en *msgp.Writer) (err error) + func (z *Block) MarshalMsg(b []byte) (o []byte, err error) + func (z *Block) Msgsize() (s int) + func (z *Block) UnmarshalMsg(bts []byte) (o []byte, err error) + type BlockBy func(b1, b2 *Block) bool + func (self BlockBy) Sort(blocks Blocks) + type BlockSigner struct + func NewBlockSigner(chainId *big.Int) BlockSigner + func (s BlockSigner) Equal(signer Signer) bool + func (s BlockSigner) Hash(h *Header) types.Hash + func (s BlockSigner) Sender(h *Header) (types.Address, error) + func (s BlockSigner) SignatureValues(h *Header, sig []byte) (R, S, V *big.Int, err error) + func (s BlockSigner) VerifySignature(h *Header) (bool, error) + type Blocks []*Block + type Body struct + Transactions []*transaction.Transaction + func (z *Body) DecodeMsg(dc *msgp.Reader) (err error) + func (z *Body) EncodeMsg(en *msgp.Writer) (err error) + func (z *Body) MarshalMsg(b []byte) (o []byte, err error) + func (z *Body) Msgsize() (s int) + func (z *Body) UnmarshalMsg(bts []byte) (o []byte, err error) + type ConsensusData struct + Id string + Para []byte + func (c *ConsensusData) UnmarshalJSON(input []byte) error + func (c ConsensusData) MarshalJSON() ([]byte, error) + func (cd ConsensusData) String() string + func (z *ConsensusData) DecodeMsg(dc *msgp.Reader) (err error) + func (z *ConsensusData) EncodeMsg(en *msgp.Writer) (err error) + func (z *ConsensusData) MarshalMsg(b []byte) (o []byte, err error) + func (z *ConsensusData) Msgsize() (s int) + func (z *ConsensusData) UnmarshalMsg(bts []byte) (o []byte, err error) + type DerivableList interface + GetMsgp func(i int) []byte + Len func() int + type Header struct + Bloom types.Bloom + Cdata ConsensusData + Extra []byte + Number *types.BigInt + ParentHash types.Hash + Producer types.Address + R *types.BigInt + ReceiptRootHash types.Hash + S *types.BigInt + StateRootHash types.Hash + Time *types.BigInt + TxRootHash types.Hash + V *types.BigInt + func CopyHeader(h *Header) *Header + func SignHeader(h *Header, s Signer, prv *ecdsa.PrivateKey) (*Header, error) + func (h *Header) AddSignature(signer Signer, sig []byte) error + func (h *Header) Hash() types.Hash + func (h *Header) String() string + func (h *Header) UnmarshalJSON(input []byte) error + func (h *Header) WithSignature(signer Signer, sig []byte) (*Header, error) + func (h Header) MarshalJSON() ([]byte, error) + func (header *Header) HashNoSig() types.Hash + func (z *Header) DecodeMsg(dc *msgp.Reader) (err error) + func (z *Header) EncodeMsg(en *msgp.Writer) (err error) + func (z *Header) MarshalMsg(b []byte) (o []byte, err error) + func (z *Header) Msgsize() (s int) + func (z *Header) UnmarshalMsg(bts []byte) (o []byte, err error) + type HeaderNoSig struct + Bloom types.Bloom + Cdata ConsensusData + Extra []byte + Number *types.BigInt + ParentHash types.Hash + Producer types.Address + ReceiptRootHash types.Hash + StateRootHash types.Hash + Time *types.BigInt + TxRootHash types.Hash + func (h *HeaderNoSig) Hash() types.Hash + func (z *HeaderNoSig) DecodeMsg(dc *msgp.Reader) (err error) + func (z *HeaderNoSig) EncodeMsg(en *msgp.Writer) (err error) + func (z *HeaderNoSig) MarshalMsg(b []byte) (o []byte, err error) + func (z *HeaderNoSig) Msgsize() (s int) + func (z *HeaderNoSig) UnmarshalMsg(bts []byte) (o []byte, err error) + type Headers struct + Headers []*Header + func (z *Headers) DecodeMsg(dc *msgp.Reader) (err error) + func (z *Headers) EncodeMsg(en *msgp.Writer) (err error) + func (z *Headers) MarshalMsg(b []byte) (o []byte, err error) + func (z *Headers) Msgsize() (s int) + func (z *Headers) UnmarshalMsg(bts []byte) (o []byte, err error) + type Signer interface + Equal func(Signer) bool + Hash func(h *Header) types.Hash + Sender func(h *Header) (types.Address, error) + SignatureValues func(h *Header, sig []byte) (r, s, v *big.Int, err error)