BlockBody

org.sigilaris.node.jvm.runtime.block.BlockBody
See theBlockBody companion class
object BlockBody

Companion for BlockBody providing canonical ordering, root computation, and verification.

Attributes

Companion
class
Source
Model.scala
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
BlockBody.type

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
Source
Mirror.scala
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror
Source
Mirror.scala

Value members

Concrete methods

def bodyRootPreImage[TxRef : ByteEncoder, ResultRef : ByteEncoder, Event : ByteEncoder](body: BlockBody[TxRef, ResultRef, Event]): Either[BlockValidationFailure, ByteVector]

Computes the raw bytes used as pre-image input for the body root hash.

Computes the raw bytes used as pre-image input for the body root hash.

Type parameters

Event

event type

ResultRef

result reference type

TxRef

transaction reference type

Value parameters

body

the block body

Attributes

Returns

the canonical byte representation, or a validation failure

Source
Model.scala
def canonicalEntries[TxRef : ByteEncoder, ResultRef : ByteEncoder, Event : ByteEncoder](body: BlockBody[TxRef, ResultRef, Event]): Either[BlockValidationFailure, Vector[(BlockRecordHash, BlockRecord[TxRef, ResultRef, Event])]]

Sorts the body's records by their canonical hash and rejects duplicates.

Sorts the body's records by their canonical hash and rejects duplicates.

Type parameters

Event

event type

ResultRef

result reference type

TxRef

transaction reference type

Value parameters

body

the block body to canonicalise

Attributes

Returns

sorted hash/record pairs, or a validation failure on duplicate hashes

Source
Model.scala
def computeBodyRoot[TxRef : ByteEncoder, ResultRef : ByteEncoder, Event : ByteEncoder](body: BlockBody[TxRef, ResultRef, Event]): Either[BlockValidationFailure, BodyRoot]

Computes the BodyRoot hash for a block body.

Computes the BodyRoot hash for a block body.

Type parameters

Event

event type

ResultRef

result reference type

TxRef

transaction reference type

Value parameters

body

the block body

Attributes

Returns

the computed body root, or a validation failure

Source
Model.scala
def verifyBodyRoot[TxRef : ByteEncoder, ResultRef : ByteEncoder, Event : ByteEncoder](body: BlockBody[TxRef, ResultRef, Event], expectedRoot: BodyRoot): Either[BlockValidationFailure, Unit]

Verifies that a block body matches the expected BodyRoot.

Verifies that a block body matches the expected BodyRoot.

Type parameters

Event

event type

ResultRef

result reference type

TxRef

transaction reference type

Value parameters

body

the block body to verify

expectedRoot

the expected body root commitment

Attributes

Returns

Right(()) if the roots match, or a validation failure describing the mismatch

Source
Model.scala