Skip to content

Commit

Permalink
mock: Add rescan to mock chanio.
Browse files Browse the repository at this point in the history
Signed-off-by: Ononiwu Maureen <59079323+Chinwendu20@users.noreply.github.com>
  • Loading branch information
Chinwendu20 authored and kaloudis committed Aug 27, 2024
1 parent 8c64a5f commit 2d656d5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lntest/mock/chainio.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
package mock

import (
"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
"github.com/btcsuite/btcwallet/waddrmgr"
)

// ChainIO is a mock implementation of the BlockChainIO interface.
type ChainIO struct {
BestHeight int32
}

func (c *ChainIO) Rescan(block *waddrmgr.BlockStamp, addrs []btcutil.Address,
outpoints map[wire.OutPoint]btcutil.Address) error {

return nil
}

// GetBestBlock currently returns dummy values.
func (c *ChainIO) GetBestBlock() (*chainhash.Hash, int32, error) {
return chaincfg.TestNet3Params.GenesisHash, c.BestHeight, nil
Expand Down

0 comments on commit 2d656d5

Please sign in to comment.