mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-31 17:51:33 +02:00
input: refactor all inputs to use MakeBaseInput, add opts
In this commit, we refactor all the other constructors for the input to use MakeBaseInput. We also add a new set of functional options as well. This'll be useful later on to ensure that new options are properly applied to all the input types.
This commit is contained in:
@@ -8,8 +8,10 @@ import (
|
||||
"github.com/btcsuite/btcd/btcec/v2/schnorr/musig2"
|
||||
"github.com/btcsuite/btcd/txscript"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/lightningnetwork/lnd/fn"
|
||||
"github.com/lightningnetwork/lnd/keychain"
|
||||
"github.com/lightningnetwork/lnd/lntypes"
|
||||
"github.com/lightningnetwork/lnd/tlv"
|
||||
"github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
@@ -127,6 +129,17 @@ func (m *MockInput) UnconfParent() *TxInfo {
|
||||
return info.(*TxInfo)
|
||||
}
|
||||
|
||||
func (m *MockInput) ResolutionBlob() fn.Option[tlv.Blob] {
|
||||
args := m.Called()
|
||||
|
||||
info := args.Get(0)
|
||||
if info == nil {
|
||||
return fn.None[tlv.Blob]()
|
||||
}
|
||||
|
||||
return info.(fn.Option[tlv.Blob])
|
||||
}
|
||||
|
||||
// MockWitnessType implements the `WitnessType` interface and is used by other
|
||||
// packages for mock testing.
|
||||
type MockWitnessType struct {
|
||||
|
Reference in New Issue
Block a user