Skip to content

Latest commit

 

History

History
109 lines (58 loc) · 3.41 KB

index.md

File metadata and controls

109 lines (58 loc) · 3.41 KB

Block

Creates a new block object

Parameters

Properties

  • header Header the block's header
  • uncleList Array<Header> an array of uncle headers
  • raw Array<Buffer> an array of buffers containing the raw blocks.

hash

Produces a hash the RLP of the block

isGenisis

Determines if a given block is the genesis block

Returns any Boolean

isHomestead

Determines if a given block part of homestead or not

Returns any Boolean

isHomesteadReprice

Determines if a given block part of homestead reprice or not

Returns any Boolean

setGenesisParams

turns the block in to the canonical genesis block

serialize

Produces a serialization of the block.

Parameters

  • rlpEncode Boolean whether to rlp encode the block or not

genTxTrie

Generate transaction trie. The tx trie must be generated before the transaction trie can be validated with validateTransactionTrie

Parameters

validateTransactionTrie

Validates the transaction trie

Returns Boolean

validateTransactions

Validates the transactions

Parameters

  • stringError Boolean? whether to return a string with a dscription of why the validation failed or return a Bloolean (optional, default false)

Returns Boolean

validate

Validates the entire block. Returns a string to the callback if block is invalid

Parameters

  • blockChain BlockChain the blockchain that this block wants to be part of
  • cb Function the callback which is given a String if the block is not valid

validateUncleHash

Validates the uncle's hash

Returns Boolean

validateUncles

Validates the uncles that are in the block if any. Returns a string to the callback if uncles are invalid

Parameters

  • blockChaina Blockchain an instance of the Blockchain
  • cb Function the callback
  • blockChain

toJSON

Converts the block toJSON

Parameters

  • labeled Bool whether to create an labeled object or an array

Returns Object