From 6fcef59d2e3c47cbf2a16e56fa32d0c923aac0b3 Mon Sep 17 00:00:00 2001 From: lazar Date: Mon, 16 Sep 2024 13:25:21 +0200 Subject: [PATCH] fix mocks --- btcclient/query.go | 3 +-- monitor/btcscanner/btc_scanner_test.go | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/btcclient/query.go b/btcclient/query.go index 1f42d92..ad5057f 100644 --- a/btcclient/query.go +++ b/btcclient/query.go @@ -12,8 +12,7 @@ import ( "github.com/babylonlabs-io/vigilante/types" ) -// GetBestBlock provides similar functionality with the btcd.rpcclient.GetBestBlock function -// We implement this, because this function is only provided by btcd. +// GetBestBlock returns the height of the best block func (c *Client) GetBestBlock() (uint64, error) { height, err := c.getBlockCountWithRetry() if err != nil { diff --git a/monitor/btcscanner/btc_scanner_test.go b/monitor/btcscanner/btc_scanner_test.go index 698dfd8..62b85f5 100644 --- a/monitor/btcscanner/btc_scanner_test.go +++ b/monitor/btcscanner/btc_scanner_test.go @@ -30,7 +30,7 @@ func FuzzBootStrap(f *testing.F) { defer ctl.Finish() mockBtcClient := mocks.NewMockBTCClient(ctl) confirmedBlocks := chainIndexedBlocks[:numBlocks-k] - mockBtcClient.EXPECT().GetBestBlock().Return(nil, uint64(bestHeight), nil) + mockBtcClient.EXPECT().GetBestBlock().Return(uint64(bestHeight), nil) for i := 0; i < int(numBlocks); i++ { mockBtcClient.EXPECT().GetBlockByHeight(gomock.Eq(uint64(chainIndexedBlocks[i].Height))). Return(chainIndexedBlocks[i], nil, nil).AnyTimes()