From c354fd8f703bf54f58c2273dae98b4bc00f4f0f9 Mon Sep 17 00:00:00 2001 From: Elle Mouton Date: Fri, 7 Feb 2025 15:27:41 +0200 Subject: [PATCH] lnmock: let MockChain also implement lnwallet.BlockChainIO Note that a compile-time assertion was not added as this leads to an import cycle. --- lnmock/chain.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lnmock/chain.go b/lnmock/chain.go index c20a89373..1470513b6 100644 --- a/lnmock/chain.go +++ b/lnmock/chain.go @@ -74,6 +74,18 @@ func (m *MockChain) GetBlockHeader(hash *chainhash.Hash) ( return args.Get(0).(*wire.BlockHeader), args.Error(1) } +func (m *MockChain) GetUtxo(op *wire.OutPoint, pkScript []byte, + heightHint uint32, cancel <-chan struct{}) (*wire.TxOut, error) { + + args := m.Called(op, pkScript, heightHint, cancel) + + if args.Get(0) == nil { + return nil, args.Error(1) + } + + return args.Get(0).(*wire.TxOut), args.Error(1) +} + func (m *MockChain) IsCurrent() bool { args := m.Called()