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: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deposit

type Deposit struct {
	FundingTxHash          bitcoin.Hash
	FundingOutputIndex     uint32
	FundingTxConfirmations uint
	FundingTx              *bitcoin.Transaction

	WalletPublicKeyHash [20]byte

	RevealBlockNumber uint64
	SweptAt           time.Time
}

Deposit holds the deposit data in the given test scenario.

type FindDepositsToSweepTestScenario

type FindDepositsToSweepTestScenario struct {
	Title string

	MaxNumberOfDeposits uint16
	WalletPublicKeyHash [20]byte

	Deposits []*Deposit

	ExpectedUnsweptDeposits []*tbtcpg.DepositReference

	SweepTxFee             int64
	EstimateSatPerVByteFee int64
}

FindDepositsToSweepTestScenario represents a test scenario of finding deposits to sweep.

func LoadFindDepositsToSweepTestScenario

func LoadFindDepositsToSweepTestScenario() ([]*FindDepositsToSweepTestScenario, error)

LoadFindDepositsToSweepTestScenario loads all scenarios related with deposit sweep.

func (*FindDepositsToSweepTestScenario) UnmarshalJSON

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

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

type FindPendingRedemptionsTestScenario

type FindPendingRedemptionsTestScenario struct {
	Title string

	ChainParameters struct {
		AverageBlockTime time.Duration
		CurrentBlock     uint64
		RequestTimeout   uint32
		RequestMinAge    uint32
	}

	MaxNumberOfRequests uint16
	WalletPublicKeyHash [20]byte

	PendingRedemptions []*RedemptionRequest

	ExpectedRedeemersOutputScripts []bitcoin.Script
}

FindPendingRedemptionsTestScenario represents a test scenario of finding pending redemptions.

func LoadFindPendingRedemptionsTestScenario

func LoadFindPendingRedemptionsTestScenario() (
	[]*FindPendingRedemptionsTestScenario,
	error,
)

LoadFindPendingRedemptionsTestScenario loads all scenarios related with finding pending redemptions.

func (*FindPendingRedemptionsTestScenario) UnmarshalJSON

func (fprts *FindPendingRedemptionsTestScenario) UnmarshalJSON(data []byte) error

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

type ProposeSweepDepositsData

type ProposeSweepDepositsData struct {
	tbtcpg.DepositReference

	Transaction            *bitcoin.Transaction
	FundingTxConfirmations uint
}

type ProposeSweepTestScenario

type ProposeSweepTestScenario struct {
	Title string

	WalletPublicKeyHash          [20]byte
	DepositTxMaxFee              uint64
	Deposits                     []*ProposeSweepDepositsData
	SweepTxFee                   int64
	EstimateSatPerVByteFee       int64
	ExpectedDepositSweepProposal *tbtc.DepositSweepProposal
	ExpectedErr                  error
}

ProposeSweepTestScenario represents a test scenario of proposing deposits sweep.

func LoadProposeSweepTestScenario

func LoadProposeSweepTestScenario() ([]*ProposeSweepTestScenario, error)

LoadProposeSweepTestScenario loads all scenarios related with deposit sweep.

func (*ProposeSweepTestScenario) DepositsReferences

func (psts *ProposeSweepTestScenario) DepositsReferences() []*tbtcpg.DepositReference

func (*ProposeSweepTestScenario) UnmarshalJSON

func (psts *ProposeSweepTestScenario) UnmarshalJSON(data []byte) error

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

type RedemptionRequest

type RedemptionRequest struct {
	WalletPublicKeyHash  [20]byte
	RedeemerOutputScript bitcoin.Script
	RequestedAmount      uint64
	RequestedAt          time.Time
	RequestBlock         uint64
}

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

Jump to

Keyboard shortcuts

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