test

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HexCompressedPubKeyLen = hex.EncodedLen(btcec.PubKeyBytesLenCompressed)
	HexTaprootPkScript     = hex.EncodedLen(input.P2TRSize)
)

Functions

func ComputeTaprootScript

func ComputeTaprootScript(t testing.TB, taprootKey *btcec.PublicKey) []byte

func ComputeTaprootScriptErr added in v0.3.0

func ComputeTaprootScriptErr(witnessProgram []byte) ([]byte, error)

func HexPubKey added in v0.3.0

func HexPubKey(pk *btcec.PublicKey) string

func HexSchnorrPubKey added in v0.3.0

func HexSchnorrPubKey(pk *btcec.PublicKey) string

func HexSignature added in v0.3.0

func HexSignature(sig *schnorr.Signature) string

func HexTx added in v0.3.0

func HexTx(t testing.TB, tx *wire.MsgTx) string

func Parse32Byte added in v0.3.0

func Parse32Byte(t testing.TB, b string) [32]byte

func Parse33Byte added in v0.3.0

func Parse33Byte(t testing.TB, b string) [33]byte

func ParseChainHash added in v0.3.0

func ParseChainHash(t testing.TB, hash string) chainhash.Hash

func ParseHex added in v0.3.0

func ParseHex(t testing.TB, b string) []byte

func ParseOutPoint added in v0.3.0

func ParseOutPoint(t testing.TB, op string) wire.OutPoint

func ParsePubKey added in v0.3.0

func ParsePubKey(t testing.TB, key string) *btcec.PublicKey

func ParseRPCKeyDescriptor

func ParseRPCKeyDescriptor(t testing.TB,
	rpcDesc *signrpc.KeyDescriptor) keychain.KeyDescriptor

func ParseSchnorrPubKey added in v0.3.0

func ParseSchnorrPubKey(t testing.TB, key string) *btcec.PublicKey

func ParseSchnorrSig added in v0.3.0

func ParseSchnorrSig(t testing.TB, sigHex string) *schnorr.Signature

func ParseTestVectors added in v0.3.0

func ParseTestVectors(t testing.TB, fileName string, target any)

func ParseTx added in v0.3.0

func ParseTx(t testing.TB, tx string) *wire.MsgTx

func PubToKeyDesc

func PubToKeyDesc(p *btcec.PublicKey) keychain.KeyDescriptor

func RandBool

func RandBool() bool

RandBool rolls a random boolean.

func RandBytes

func RandBytes(num int) []byte

func RandHash

func RandHash() chainhash.Hash

func RandInt

func RandInt[T constraints.Integer]() T

RandInt makes a random integer of the specified type.

func RandInt31n added in v0.3.0

func RandInt31n(n int32) int32

RandInt31n returns a random 32-bit integer in the range [0, n).

func RandIntn added in v0.3.0

func RandIntn(n int) int

RandIntn returns a random integer in the range [0, n).

func RandOp

func RandOp(t testing.TB) wire.OutPoint

func RandPrivKey

func RandPrivKey(_ testing.TB) *btcec.PrivateKey

func RandPubKey

func RandPubKey(t testing.TB) *btcec.PublicKey

func RandRead added in v0.3.0

func RandRead(t testing.TB, b []byte)

RandRead fills the passed byte slice with random data.

func RandTxWitnesses

func RandTxWitnesses(t testing.TB) wire.TxWitness

func SchnorrKey

func SchnorrKey(t testing.TB, pubKey *btcec.PublicKey) *btcec.PublicKey

func SchnorrPubKey

func SchnorrPubKey(t testing.TB, privKey *btcec.PrivateKey) *btcec.PublicKey

func ScriptHashLock

func ScriptHashLock(t *testing.T, preimage []byte) txscript.TapLeaf

ScriptHashLock returns a simple bitcoin script that locks the funds to a hash lock of the given preimage.

func ScriptSchnorrSig

func ScriptSchnorrSig(t *testing.T, pubKey *btcec.PublicKey) txscript.TapLeaf

ScriptSchnorrSig returns a simple bitcoin script that locks the funds to a Schnorr signature of the given public key.

func WriteTestFileHex added in v0.3.0

func WriteTestFileHex(t testing.TB, fileName string, content []byte)

func WriteTestVectors added in v0.3.0

func WriteTestVectors(t testing.TB, fileName string, target any)

Types

This section is empty.

Jump to

Keyboard shortcuts

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