Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move mockery configs to single config file #932

Merged
merged 3 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -103,6 +103,7 @@ gomodtidy: gomods
.PHONY: mockery
mockery: $(mockery) ## Install mockery.
go install github.com/vektra/mockery/[email protected]
mockery
jmank88 marked this conversation as resolved.
Show resolved Hide resolved

.PHONY: rm-mocked
rm-mocked:
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
Loading