MCPcopy Create free account
hub / github.com/chain/txvm / newInitialBlock

Function newInitialBlock

protocol/validation/validation_test.go:291–303  ·  view source on GitHub ↗
(tb testing.TB)

Source from the content-addressed store, hash-verified

289}
290
291func newInitialBlock(tb testing.TB) *bc.UnsignedBlock {
292 root := bc.TxMerkleRoot(nil) // calculate the zero value of the tx merkle root
293
294 return &bc.UnsignedBlock{
295 BlockHeader: &bc.BlockHeader{
296 Version: 3,
297 Height: 1,
298 TimestampMs: bc.Millis(time.Now()),
299 TransactionsRoot: &root,
300 NextPredicate: &bc.Predicate{Version: 1, Quorum: 0},
301 },
302 }
303}
304
305func generate(tb testing.TB, prev *bc.UnsignedBlock) *bc.UnsignedBlock {
306 prevID := prev.Hash()

Callers 1

TestBlockFunction · 0.85

Calls 2

TxMerkleRootFunction · 0.92
MillisFunction · 0.92

Tested by

no test coverage detected