test

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package tbtctest contains scenarios meant to be used for Bitcoin-related tests in the pkg/tbtc package. Here are the details of specific scenarios:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deposit

type Deposit struct {
	Utxo                *bitcoin.UnspentTransactionOutput
	Depositor           chain.Address
	BlindingFactor      [8]byte
	WalletPublicKeyHash [20]byte
	RefundPublicKeyHash [20]byte
	RefundLocktime      [4]byte
	Vault               *chain.Address
	ExtraData           *[32]byte
}

Deposit holds the deposit data in the given test scenario.

type DepositSweepTestScenario

type DepositSweepTestScenario struct {
	Title             string
	WalletPublicKey   *ecdsa.PublicKey
	WalletPrivateKey  *big.Int
	WalletMainUtxo    *bitcoin.UnspentTransactionOutput
	Deposits          []*Deposit
	InputTransactions []*bitcoin.Transaction
	Fee               int64
	Signatures        []*bitcoin.SignatureContainer

	ExpectedSigHashes                   []*big.Int
	ExpectedSweepTransaction            *bitcoin.Transaction
	ExpectedSweepTransactionHash        bitcoin.Hash
	ExpectedSweepTransactionWitnessHash bitcoin.Hash
}

DepositSweepTestScenario represents a deposit sweep test scenario.

func LoadDepositSweepTestScenarios

func LoadDepositSweepTestScenarios() ([]*DepositSweepTestScenario, error)

LoadDepositSweepTestScenarios loads all scenarios related with deposit sweep.

func (*DepositSweepTestScenario) UnmarshalJSON

func (dsts *DepositSweepTestScenario) UnmarshalJSON(data []byte) error

UnmarshalJSON implements a custom JSON unmarshaling logic to produce a proper DepositSweepTestScenario.

type RedemptionRequest

type RedemptionRequest struct {
	Redeemer             chain.Address
	RedeemerOutputScript []byte
	RequestedAmount      uint64
	TreasuryFee          uint64
	TxMaxFee             uint64
	RequestedAt          time.Time
}

RedemptionRequest holds the redemption request data in the given test scenario.

type RedemptionTestScenario

type RedemptionTestScenario struct {
	Title              string
	WalletPublicKey    *ecdsa.PublicKey
	WalletPrivateKey   *big.Int
	WalletMainUtxo     *bitcoin.UnspentTransactionOutput
	RedemptionRequests []*RedemptionRequest
	InputTransaction   *bitcoin.Transaction
	FeeShares          []int64
	Signature          *bitcoin.SignatureContainer

	ExpectedSigHash                          *big.Int
	ExpectedRedemptionTransaction            *bitcoin.Transaction
	ExpectedRedemptionTransactionHash        bitcoin.Hash
	ExpectedRedemptionTransactionWitnessHash bitcoin.Hash
}

RedemptionTestScenario represents a redemption test scenario.

func LoadRedemptionTestScenarios

func LoadRedemptionTestScenarios() ([]*RedemptionTestScenario, error)

LoadRedemptionTestScenarios loads all scenarios related with redemption.

func (*RedemptionTestScenario) UnmarshalJSON

func (rts *RedemptionTestScenario) UnmarshalJSON(data []byte) error

UnmarshalJSON implements a custom JSON unmarshaling logic to produce a proper RedemptionTestScenario.

Jump to

Keyboard shortcuts

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