block

package
v0.0.0-...-5d05a64 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeBlockHash

func ComputeBlockHash(b *Block) common.Hash

func GetBlockStorageKey

func GetBlockStorageKey(blockHeaderHash common.Hash) []byte

Types

type Block

type Block struct {
	// contains filtered or unexported fields
}

func BlockFromPBData

func BlockFromPBData(block *protos.Block) *Block

func GetBlock

func GetBlock(db *db.DB, blockHeaderHash common.Hash) (*Block, error)

func GetBlockByNumber

func GetBlockByNumber(db *db.DB, slotNumber uint64) (*Block, error)

func NewBlock

func NewBlock(chainId uint64, timestamp uint64, proposerDilithiumPK []byte, slotNumber uint64,
	parentHeaderHash common.Hash, txs []*protos.Transaction, protocolTxs []*protos.ProtocolTransaction,
	signerNonce uint64) *Block

func (*Block) AddAttestTx

func (b *Block) AddAttestTx(attestTx *transactions.Attest)

func (*Block) Attest

func (b *Block) Attest(chainID uint64, d *dilithium.Dilithium, attestorNonce uint64) (*transactions.Attest, error)

func (*Block) BlockSigningHash

func (b *Block) BlockSigningHash() common.Hash

func (*Block) DeSerialize

func (b *Block) DeSerialize(data []byte) error

func (*Block) Epoch

func (b *Block) Epoch() uint64

func (*Block) GasLimit

func (b *Block) GasLimit() uint64

func (*Block) GetBlockProposer

func (b *Block) GetBlockProposer() common.Address

func (*Block) GetPendingValidatorsUpdate

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

func (*Block) Hash

func (b *Block) Hash() common.Hash

func (*Block) Header

func (b *Block) Header() *Header

func (*Block) Minter

func (b *Block) Minter() *common.Address

func (*Block) Number

func (b *Block) Number() uint64

func (*Block) PBData

func (b *Block) PBData() *protos.Block

func (*Block) ParentHash

func (b *Block) ParentHash() common.Hash

func (*Block) PartialBlockSigningHash

func (b *Block) PartialBlockSigningHash() common.Hash

func (*Block) ProtocolTransactions

func (b *Block) ProtocolTransactions() []*protos.ProtocolTransaction

func (*Block) Serialize

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

func (*Block) SignByProposer

func (b *Block) SignByProposer(d *dilithium.Dilithium)

func (*Block) SlotNumber

func (b *Block) SlotNumber() uint64

func (*Block) Timestamp

func (b *Block) Timestamp() uint64

func (*Block) Transactions

func (b *Block) Transactions() []*protos.Transaction

func (*Block) UpdateBloom

func (b *Block) UpdateBloom(protocolTxBloom, txBloom [256]byte)

func (*Block) UpdateFinalizedEpoch

func (b *Block) UpdateFinalizedEpoch(db *db.DB, stateContext *state.StateContext) error

func (*Block) UpdateRoots

func (b *Block) UpdateRoots(trieRoot common.Hash)
type Header struct {
	// contains filtered or unexported fields
}

func HeaderFromPBData

func HeaderFromPBData(header *protos.BlockHeader) *Header

func (*Header) BaseFee

func (h *Header) BaseFee() *big.Int

func (*Header) GasLimit

func (h *Header) GasLimit() uint64

func (*Header) GasUsed

func (h *Header) GasUsed() *big.Int

func (*Header) Hash

func (h *Header) Hash() common.Hash

func (*Header) Number

func (h *Header) Number() *big.Int

func (*Header) PBData

func (h *Header) PBData() *protos.BlockHeader

func (*Header) ParentHash

func (h *Header) ParentHash() common.Hash

func (*Header) ReceiptsRoot

func (h *Header) ReceiptsRoot() common.Hash

func (*Header) Root

func (h *Header) Root() common.Hash

func (*Header) Timestamp

func (h *Header) Timestamp() *big.Int

func (*Header) TransactionsRoot

func (h *Header) TransactionsRoot() common.Hash

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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