Companion for BlockBody providing canonical ordering, root computation, and verification.
Attributes
- Companion
- class
- Source
- Model.scala
- Graph
-
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
BlockBody.type
Members list
Type members
Inherited and Abstract types
The names of the product elements
The name of the type
Value members
Concrete methods
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
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
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
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