Skip to content

Commit

Permalink
Move mockery configs to single config file (#932)
Browse files Browse the repository at this point in the history
* move mockery to config file and update go version in build script

* add mockery to makefile
  • Loading branch information
EasterTheBunny authored Nov 20, 2024
1 parent e2db20a commit 43eb124
Show file tree
Hide file tree
Showing 35 changed files with 2,750 additions and 938 deletions.
39 changes: 39 additions & 0 deletions .mockery.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
dir: "{{ .InterfaceDir }}/mocks"
mockname: "{{ .InterfaceName }}"
outpkg: mocks
filename: "{{ .InterfaceName | snakecase }}.go"
packages:
github.com/smartcontractkit/chainlink-solana/pkg/monitoring:
interfaces:
ChainReader:
github.com/smartcontractkit/chainlink-solana/pkg/monitoring/metrics:
interfaces:
FeedBalances:
Fees:
config:
filename: "Fees.go"
NetworkFees:
NodeBalances:
NodeSuccess:
ReportObservations:
SlotHeight:
github.com/smartcontractkit/chainlink-solana/pkg/solana/client:
interfaces:
ReaderWriter:
github.com/smartcontractkit/chainlink-solana/pkg/solana/config:
interfaces:
Config:
config:
filename: config.go
case: underscore
github.com/smartcontractkit/chainlink-solana/pkg/solana/fees:
interfaces:
Estimator:
config:
filename: "Estimator.go"
github.com/smartcontractkit/chainlink-solana/pkg/solana/txm:
interfaces:
SimpleKeystore:
config:
filename: simple_keystore.go
case: underscore
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ rm-mocked:
.PHONY: generate
generate: mockery gomods
gomods -w go generate -x ./...
mockery

.PHONY: lint-go-integration-tests
lint-go-integration-tests:
Expand Down
1 change: 0 additions & 1 deletion pkg/monitoring/chain_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"github.com/smartcontractkit/chainlink-solana/pkg/solana/client"
)

//go:generate mockery --name ChainReader --output ./mocks/
type ChainReader interface {
GetState(ctx context.Context, account solana.PublicKey, commitment rpc.CommitmentType) (state pkgSolana.State, blockHeight uint64, err error)
GetLatestTransmission(ctx context.Context, account solana.PublicKey, commitment rpc.CommitmentType) (answer pkgSolana.Answer, blockHeight uint64, err error)
Expand Down
2 changes: 0 additions & 2 deletions pkg/monitoring/metrics/feedbalances.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import (
commonMonitoring "github.com/smartcontractkit/chainlink-common/pkg/monitoring"
)

//go:generate mockery --name FeedBalances --output ./mocks/

type FeedBalances interface {
Exists(balanceAccountName string) (*prometheus.GaugeVec, bool)
SetBalance(balance uint64, balanceAccountName string, feedInput FeedInput)
Expand Down
2 changes: 0 additions & 2 deletions pkg/monitoring/metrics/fees.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
"github.com/smartcontractkit/chainlink-solana/pkg/solana/fees"
)

//go:generate mockery --name Fees --output ./mocks/

type Fees interface {
Set(txFee uint64, computeUnitPrice fees.ComputeUnitPrice, feedInput FeedInput)
Cleanup(feedInput FeedInput)
Expand Down
69 changes: 0 additions & 69 deletions pkg/monitoring/metrics/mocks/FeedBalances.go

This file was deleted.

66 changes: 66 additions & 0 deletions pkg/monitoring/metrics/mocks/Fees.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 0 additions & 37 deletions pkg/monitoring/metrics/mocks/NetworkFees.go

This file was deleted.

34 changes: 0 additions & 34 deletions pkg/monitoring/metrics/mocks/NodeBalances.go

This file was deleted.

37 changes: 0 additions & 37 deletions pkg/monitoring/metrics/mocks/NodeSuccess.go

This file was deleted.

37 changes: 0 additions & 37 deletions pkg/monitoring/metrics/mocks/ReportObservations.go

This file was deleted.

Loading

0 comments on commit 43eb124

Please sign in to comment.