block

package
v1.0.5-beta Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2019 License: Apache-2.0 Imports: 13 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeID

func ComputeID(preBlockHash, txnHash Uint256, randomBeacon []byte) []byte

Types

type Block

type Block struct {
	Header       *Header
	Transactions []*transaction.Transaction
}

func GenesisBlockInit

func GenesisBlockInit() (*Block, error)

func (*Block) FromMsgBlock

func (b *Block) FromMsgBlock(msgBlock *pb.Block)

func (*Block) FromTrimmedData

func (b *Block) FromTrimmedData(r io.Reader) error

func (*Block) GetInfo

func (b *Block) GetInfo() ([]byte, error)

func (*Block) GetMessage

func (b *Block) GetMessage() []byte

func (*Block) GetProgramHashes

func (b *Block) GetProgramHashes() ([]Uint160, error)

func (*Block) GetPrograms

func (b *Block) GetPrograms() []*pb.Program

func (*Block) GetSigner

func (b *Block) GetSigner() ([]byte, []byte, error)

func (*Block) GetTxsSize

func (b *Block) GetTxsSize() int

func (*Block) Hash

func (b *Block) Hash() Uint256

func (*Block) Marshal

func (b *Block) Marshal() (data []byte, err error)

func (*Block) RebuildMerkleRoot

func (b *Block) RebuildMerkleRoot() error

func (*Block) SerializeUnsigned

func (b *Block) SerializeUnsigned(w io.Writer) error

func (*Block) SetPrograms

func (b *Block) SetPrograms(prog []*pb.Program)

func (*Block) ToArray

func (b *Block) ToArray() []byte

func (*Block) ToMsgBlock

func (b *Block) ToMsgBlock() *pb.Block

func (*Block) Trim

func (b *Block) Trim(w io.Writer) error

func (*Block) Unmarshal

func (b *Block) Unmarshal(buf []byte) error

func (*Block) Verify

func (b *Block) Verify() error
type Header struct {
	*pb.Header
	// contains filtered or unexported fields
}

func (*Header) DeserializeUnsigned

func (h *Header) DeserializeUnsigned(r io.Reader) error

func (*Header) GetInfo

func (h *Header) GetInfo() ([]byte, error)

func (*Header) GetMessage

func (h *Header) GetMessage() []byte

func (*Header) GetProgramHashes

func (h *Header) GetProgramHashes() ([]Uint160, error)

func (*Header) GetPrograms

func (h *Header) GetPrograms() []*pb.Program

func (*Header) Hash

func (h *Header) Hash() Uint256

func (*Header) Marshal

func (h *Header) Marshal() (buf []byte, err error)

func (*Header) SerializeUnsigned

func (h *Header) SerializeUnsigned(w io.Writer) error

Serialize the blockheader data without program

func (*Header) SetPrograms

func (h *Header) SetPrograms(programs []*pb.Program)

func (*Header) ToArray

func (h *Header) ToArray() []byte

func (*Header) Unmarshal

func (h *Header) Unmarshal(buf []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL