block

package
v0.0.0-...-85922c0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Height           uint64                             `json:"height"`
	PrevHash         []byte                             `json:"prevHash"`
	Hash             []byte                             `json:"hash"`
	Transactions     []*transaction.FinishedTransaction `json:"transactions"`
	Root             []byte                             `json:"root"`
	SnapRoot         []byte                             `json:"snaproot"`
	Version          uint64                             `json:"version"`
	Timestamp        uint64                             `json:"timestamp"`
	UsedTime         uint64                             `json:"usedtime"`
	Miner            address.Address                    `json:"miner"`
	Difficulty       *big.Int                           `json:"difficulty"`
	GlobalDifficulty *big.Int                           `json:"globaldifficulty"`
	Nonce            uint64                             `json:"nonce"`
	GasLimit         uint64                             `json:"gasLimit"`
	GasUsed          uint64                             `json:"gasUsed"`
}

Block Struct

func Deserialize

func Deserialize(data []byte) (*Block, error)

Deserialize deserialization of JSON formatted block data errUpdated

func (*Block) MarshalCBOR

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

func (*Block) MinerHash

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

SetHash hash the block data

func (*Block) Serialize

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

Serialize serialization using JSON format errUpdated

func (*Block) SetHash

func (b *Block) SetHash() error

SetHash hash the block data

func (*Block) UnmarshalCBOR

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

func (*Block) Verify

func (b *Block) Verify()

type BlockHead

type BlockHead struct {
	Height      uint64
	Hash        []byte
	Host        string
	Port        string
	GenesisHash string
}

Jump to

Keyboard shortcuts

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