testpiece

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package testpiece builds, for tests and benchmarks, a BEEF shaped as a storage piece carrier: an Atomic BEEF (BRC-95) over a BEEF V2 (BRC-96) holding one BUMP and two transactions, a mined funding transaction and the unmined carrier that spends it, whose one output carries the piece in a push. In a storage deployment these carry most of the lane's bytes, so they are the shape the bridge's per-object costs are measured on.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Piece

type Piece struct {
	BEEF    []byte
	Tracker *Roots
	// TxID is the carrier's txid, the Atomic BEEF's subject.
	TxID chainhash.Hash
}

Piece is one carrier BEEF and the chain tracker its funding proof verifies against.

func New

func New(tb testing.TB, size int) *Piece

New builds a piece carrier whose output pushes size bytes. The funding transaction is mined alone in block 100, so its txid is the root.

type Roots

type Roots struct {
	M   map[uint32]chainhash.Hash
	Tip uint32
}

Roots is a chain tracker over a fixed height->root map.

func (*Roots) CurrentHeight

func (r *Roots) CurrentHeight(context.Context) (uint32, error)

CurrentHeight returns the fixed tip.

func (*Roots) IsValidRootForHeight

func (r *Roots) IsValidRootForHeight(_ context.Context, root *chainhash.Hash, h uint32) (bool, error)

IsValidRootForHeight reports whether root is the root held for height.

Jump to

Keyboard shortcuts

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