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

Commit

Permalink
chore: remove unnecessary EVM client interface
Browse files Browse the repository at this point in the history
  • Loading branch information
rach-id committed Feb 9, 2023
1 parent acd5c2f commit 04a0fcc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 35 deletions.
35 changes: 2 additions & 33 deletions evm/evm_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,39 +18,6 @@ import (

const DEFAULTEVMGASLIMIT = uint64(25000000)

var _ ClientI = &Client{}

type ClientI interface {
DeployQGBContract(
opts *bind.TransactOpts,
backend bind.ContractBackend,
contractInitValset types.Valset,
contractInitNonce uint64,
initBridge bool,
) (gethcommon.Address, *coregethtypes.Transaction, *wrapper.QuantumGravityBridge, error)
UpdateValidatorSet(
opts *bind.TransactOpts,
newNonce, newThreshHold uint64,
currentValset, newValset types.Valset,
sigs []wrapper.Signature,
) (*coregethtypes.Transaction, error)
SubmitDataRootTupleRoot(
opts *bind.TransactOpts,
tupleRoot gethcommon.Hash,
lastDataCommitmentNonce uint64,
currentValset types.Valset,
sigs []wrapper.Signature,
) (*coregethtypes.Transaction, error)
StateLastEventNonce(opts *bind.CallOpts) (uint64, error)
WaitForTransaction(
ctx context.Context,
backend bind.DeployBackend,
tx *coregethtypes.Transaction,
) (*coregethtypes.Receipt, error)
NewEthClient() (*ethclient.Client, error)
NewTransactionOpts(ctx context.Context) (*bind.TransactOpts, error)
}

type Client struct {
logger tmlog.Logger
Wrapper *wrapper.QuantumGravityBridge
Expand Down Expand Up @@ -93,6 +60,8 @@ func (ec *Client) NewEthClient() (*ethclient.Client, error) {
// and log relevant information.
// The initBridge, when set to true, will assign the newly deployed bridge to the wrapper. This
// later can be used for further interactions with the new contract.
// Multiple calls to DeployQGBContract with the initBridge flag set to true will overwrite everytime
// the bridge contract.
func (ec *Client) DeployQGBContract(
opts *bind.TransactOpts,
backend bind.ContractBackend,
Expand Down
4 changes: 2 additions & 2 deletions relayer/relayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ type Relayer struct {
TmQuerier rpc.TmQuerierI
AppQuerier rpc.AppQuerierI
P2PQuerier p2p.QuerierI
EVMClient evm.ClientI
EVMClient *evm.Client
logger tmlog.Logger
}

func NewRelayer(
tmQuerier rpc.TmQuerierI,
appQuerier rpc.AppQuerierI,
p2pQuerier p2p.QuerierI,
evmClient evm.ClientI,
evmClient *evm.Client,
logger tmlog.Logger,
) (*Relayer, error) {
return &Relayer{
Expand Down

0 comments on commit 04a0fcc

Please sign in to comment.