proofers

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidParameters = errors.New("invalid parameters")

Functions

This section is empty.

Types

type Data added in v1.4.0

type Data interface {
	blockchain.Data
}

Data ...

It's used only for mock generating.

type ProofOfWork

type ProofOfWork struct {
	TargetBit                int
	MaxAttemptCount          mo.Option[int]
	RandomInitialNonceParams mo.Option[powValueTypes.RandomNonceParams]
}

ProofOfWork ...

func (ProofOfWork) Difficulty added in v1.4.0

func (proofer ProofOfWork) Difficulty(hash string) (int, error)

Difficulty ...

func (ProofOfWork) Hash deprecated

func (proofer ProofOfWork) Hash(block blockchain.Block) string

Hash ...

Deprecated: Use ProofOfWork.HashEx instead.

func (ProofOfWork) HashEx added in v1.4.1

func (proofer ProofOfWork) HashEx(
	ctx context.Context,
	block blockchain.Block,
) (string, error)

HashEx ...

func (ProofOfWork) Validate

func (proofer ProofOfWork) Validate(block blockchain.Block) error

Validate ...

Jump to

Keyboard shortcuts

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