Skip to content

Commit

Permalink
Trigger mock generations through go generate (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
kirugan authored Jan 16, 2025
1 parent 2a2d342 commit 9506444
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,8 @@ run-local:
./bin/local-startup.sh;
go run cmd/babylon-staking-indexer/main.go --config config/config-local.yml

generate-mock-interface:
cd internal/db && mockery --name=DbInterface --output=../../tests/mocks --outpkg=mocks --filename=mock_db_client.go
cd internal/clients/btcclient && mockery --name=BtcInterface --output=../../../tests/mocks --outpkg=mocks --filename=mock_btc_client.go
cd internal/clients/bbnclient && mockery --name=BbnInterface --output=../../../tests/mocks --outpkg=mocks --filename=mock_bbn_client.go
generate:
go generate ./...

test:
./bin/local-startup.sh;
Expand Down
1 change: 1 addition & 0 deletions internal/clients/bbnclient/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
ctypes "github.com/cometbft/cometbft/rpc/core/types"
)

//go:generate mockery --name=BbnInterface --output=../../../tests/mocks --outpkg=mocks --filename=mock_bbn_client.go
type BbnInterface interface {
GetCheckpointParams(ctx context.Context) (*CheckpointParams, error)
GetAllStakingParams(ctx context.Context) (map[uint32]*StakingParams, error)
Expand Down
1 change: 1 addition & 0 deletions internal/clients/btcclient/interface.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package btcclient

//go:generate mockery --name=BtcInterface --output=../../../tests/mocks --outpkg=mocks --filename=mock_btc_client.go
type BtcInterface interface {
GetTipHeight() (uint64, error)
}
1 change: 1 addition & 0 deletions internal/db/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/babylonlabs-io/babylon-staking-indexer/internal/types"
)

//go:generate mockery --name=DbInterface --output=../../tests/mocks --outpkg=mocks --filename=mock_db_client.go
type DbInterface interface {
/**
* Ping checks the database connection.
Expand Down

0 comments on commit 9506444

Please sign in to comment.