templates

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: AGPL-3.0 Imports: 7 Imported by: 10

Documentation

Index

Constants

View Source
const (
	AlwaysFalseID byte = iota
	AlwaysTrueID
	P2pkh256ID
)
View Source
const TemplateStartByte = 0x00

Variables

This section is empty.

Functions

func AlwaysFalseBytes

func AlwaysFalseBytes() predicates.PredicateBytes

func AlwaysTrueArgBytes

func AlwaysTrueArgBytes() []byte

func AlwaysTrueBytes

func AlwaysTrueBytes() predicates.PredicateBytes

func ExtractPubKeyHashFromP2pkhPredicate

func ExtractPubKeyHashFromP2pkhPredicate(pb []byte) ([]byte, error)

func IsP2pkhTemplate

func IsP2pkhTemplate(predicate *predicates.Predicate) bool

func NewP2pkh256BytesFromKey

func NewP2pkh256BytesFromKey(pubKey []byte) predicates.PredicateBytes

func NewP2pkh256BytesFromKeyHash

func NewP2pkh256BytesFromKeyHash(pubKeyHash []byte) predicates.PredicateBytes

func NewP2pkh256FromKey

func NewP2pkh256FromKey(pubKey []byte) predicates.Predicate

func NewP2pkh256FromKeyHash

func NewP2pkh256FromKeyHash(pubKeyHash []byte) predicates.Predicate

func NewP2pkh256SignatureBytes

func NewP2pkh256SignatureBytes(sig, pubKey []byte) []byte

Types

type AlwaysFalse

type AlwaysFalse struct{}

func (*AlwaysFalse) Execute

func (t *AlwaysFalse) Execute(_, _, _ []byte) error

func (*AlwaysFalse) ID

func (t *AlwaysFalse) ID() byte

type AlwaysTrue

type AlwaysTrue struct{}

func (*AlwaysTrue) Execute

func (t *AlwaysTrue) Execute(_, sig, _ []byte) error

func (*AlwaysTrue) ID

func (t *AlwaysTrue) ID() byte

type P2pkh256

type P2pkh256 struct{}

func (*P2pkh256) Execute

func (t *P2pkh256) Execute(pubKeyHash, sig, sigData []byte) error

func (*P2pkh256) ID

func (t *P2pkh256) ID() byte

type PredicateTemplate

type PredicateTemplate interface {
	ID() byte
	Execute(bytes, sig, sigData []byte) error
}

type TemplateRunner

type TemplateRunner struct {
	// contains filtered or unexported fields
}

func (*TemplateRunner) Execute

func (t *TemplateRunner) Execute(p *predicates.Predicate, sig []byte, sigData []byte) error

Jump to

Keyboard shortcuts

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