Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
Added mockery config (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
begmaroman authored Jan 24, 2024
1 parent d8f2b45 commit 5d3ec2d
Show file tree
Hide file tree
Showing 10 changed files with 1,032 additions and 8 deletions.
36 changes: 36 additions & 0 deletions .mockery.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
with-expecter: true
dir: "mocks"
filename: "{{.InterfaceName | lower }}.generated.go"
mockname: "{{.InterfaceName}}"
outpkg: "mocks"
packages:
github.com/0xPolygon/beethoven/etherman:
config:
interfaces:
IEthereumClient:
config:
mockname: EthereumClientMock
filename: etherman_client.generated.go
github.com/0xPolygon/beethoven/types:
config:
interfaces:
IDB:
config:
mockname: DBMock
filename: db.generated.go
IEtherman:
config:
mockname: EthermanMock
filename: etherman.generated.go
IEthTxManager:
config:
mockname: EthTxManagerMock
filename: eth_tx_manager.generated.go
IZkEVMClient:
config:
mockname: ZkEVMClientMock
filename: zk_evm_client.generated.go
IZkEVMClientClientCreator:
config:
mockname: ZkEVMClientClientCreatorMock
filename: zk_evm_client_creator.generated.go
3 changes: 1 addition & 2 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ import (
"time"

"github.com/0xPolygon/beethoven/rpc/types"
"github.com/0xPolygon/beethoven/tx"
"github.com/0xPolygonHermez/zkevm-node/ethtxmanager"
"github.com/0xPolygonHermez/zkevm-node/jsonrpc/client"
"github.com/ethereum/go-ethereum/common"

"github.com/0xPolygon/beethoven/tx"
)

// ClientFactoryInterface interface for the client factory
Expand Down
1 change: 0 additions & 1 deletion etherman/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"github.com/ethereum/go-ethereum/accounts/abi/bind"
)

//go:generate mockery --name IEthereumClient --structname EthereumClientMock --output ../mocks --case=underscore --filename etherman_client.generated.go
type IEthereumClient interface {
ethereum.ChainReader
ethereum.ChainStateReader
Expand Down
36 changes: 36 additions & 0 deletions mocks/db.generated.go

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

137 changes: 137 additions & 0 deletions mocks/eth_tx_manager.generated.go

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

Loading

0 comments on commit 5d3ec2d

Please sign in to comment.