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:
Olaoluwa Osuntokun committed 2024-11-14 16:09:58 -08:00
1 parent af60fa0c3a
commit 1e7c5415ae
3 files changed
+46 -1

No files matched your search

+11
View File
@@ -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 {