mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-27 14:11:04 +02:00
input: add new Preimage method to input.Input
In this commit, we add a new method to obtain an option of a preimage to the input.Input struct. This is useful for callers that have an Input, and want to optionally obtain the preimage.
This commit is contained in:
@@ -140,6 +140,17 @@ func (m *MockInput) ResolutionBlob() fn.Option[tlv.Blob] {
|
||||
return info.(fn.Option[tlv.Blob])
|
||||
}
|
||||
|
||||
func (m *MockInput) Preimage() fn.Option[lntypes.Preimage] {
|
||||
args := m.Called()
|
||||
|
||||
info := args.Get(0)
|
||||
if info == nil {
|
||||
return fn.None[lntypes.Preimage]()
|
||||
}
|
||||
|
||||
return info.(fn.Option[lntypes.Preimage])
|
||||
}
|
||||
|
||||
// MockWitnessType implements the `WitnessType` interface and is used by other
|
||||
// packages for mock testing.
|
||||
type MockWitnessType struct {
|
||||
|
Reference in New Issue
Block a user