Skip to content

Commit

Permalink
fix mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Lazar955 committed Sep 16, 2024
1 parent 48e5d1c commit 6fcef59
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions btcclient/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion monitor/btcscanner/btc_scanner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 6fcef59

Please sign in to comment.