block

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeID

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

Types

type Block

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

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() ([]common.Uint160, error)

func (*Block) GetPrograms

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

func (*Block) GetTxsSize

func (b *Block) GetTxsSize() int

func (*Block) Hash

func (b *Block) Hash() common.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

	IsHeaderChecked bool
	// 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() ([]common.Uint160, error)

func (*Header) GetPrograms

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

func (*Header) GetSigner

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

func (*Header) Hash

func (h *Header) Hash() common.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

func (*Header) VerifySignature

func (h *Header) VerifySignature() error

Jump to

Keyboard shortcuts

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