From 04a0fcc0fffc5611f50380cdf73ff038949ad999 Mon Sep 17 00:00:00 2001 From: rachid Date: Thu, 9 Feb 2023 12:59:10 +0100 Subject: [PATCH] chore: remove unnecessary EVM client interface --- evm/evm_client.go | 35 ++--------------------------------- relayer/relayer.go | 4 ++-- 2 files changed, 4 insertions(+), 35 deletions(-) diff --git a/evm/evm_client.go b/evm/evm_client.go index 46335d2d..fde2ac45 100644 --- a/evm/evm_client.go +++ b/evm/evm_client.go @@ -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 @@ -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, diff --git a/relayer/relayer.go b/relayer/relayer.go index 01a146de..ea869f9e 100644 --- a/relayer/relayer.go +++ b/relayer/relayer.go @@ -23,7 +23,7 @@ type Relayer struct { TmQuerier rpc.TmQuerierI AppQuerier rpc.AppQuerierI P2PQuerier p2p.QuerierI - EVMClient evm.ClientI + EVMClient *evm.Client logger tmlog.Logger } @@ -31,7 +31,7 @@ func NewRelayer( tmQuerier rpc.TmQuerierI, appQuerier rpc.AppQuerierI, p2pQuerier p2p.QuerierI, - evmClient evm.ClientI, + evmClient *evm.Client, logger tmlog.Logger, ) (*Relayer, error) { return &Relayer{