testutils

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NUM_BLOCKS    int64 = 110
	BOLT11_METHOD       = "bolt11"
	SAT_UNIT            = "sat"
)

Variables

This section is empty.

Functions

func ConstructProofs

func ConstructProofs(blindedSignatures cashu.BlindedSignatures,
	secrets []string, rs []*secp256k1.PrivateKey, keyset *crypto.MintKeyset) (cashu.Proofs, error)

func CreateBlindedMessages

func CreateBlindedMessages(amount uint64, keyset crypto.MintKeyset) (cashu.BlindedMessages, []string, []*secp256k1.PrivateKey, error)

func CreateTestMint

func CreateTestMint(
	lnd *btcdocker.Lnd,
	dbpath string,
	dbMigrationPath string,
	inputFeePpk uint,
	limits mint.MintLimits,
) (*mint.Mint, error)

func CreateTestMintServer

func CreateTestMintServer(
	lnd *btcdocker.Lnd,
	port string,
	dbpath string,
	dbMigrationPath string,
	inputFeePpk uint,
) (*mint.MintServer, error)

func CreateTestWallet

func CreateTestWallet(walletpath, defaultMint string) (*wallet.Wallet, error)

func Fees

func Fees(proofs cashu.Proofs, mint string) (uint, error)

func FundCashuWallet

func FundCashuWallet(ctx context.Context, wallet *wallet.Wallet, lnd *btcdocker.Lnd, amount uint64) error

func FundLndNode

func FundLndNode(ctx context.Context, bitcoind *btcdocker.Bitcoind, lnd *btcdocker.Lnd) error

func GetValidProofsForAmount

func GetValidProofsForAmount(amount uint64, mint *mint.Mint, payer *btcdocker.Lnd) (cashu.Proofs, error)

func MineBlocks

func MineBlocks(bitcoind *btcdocker.Bitcoind, numBlocks int64) error

func OpenChannel

func OpenChannel(
	ctx context.Context,
	bitcoind *btcdocker.Bitcoind,
	from *btcdocker.Lnd,
	to *btcdocker.Lnd,
	amount int64,
) error

func SyncLndNode

func SyncLndNode(ctx context.Context, lnd *btcdocker.Lnd) error

Types

type NutshellMintContainer

type NutshellMintContainer struct {
	testcontainers.Container
	Host string
}

func CreateNutshellMintContainer

func CreateNutshellMintContainer(ctx context.Context) (*NutshellMintContainer, error)

Jump to

Keyboard shortcuts

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