Skip to content

Commit

Permalink
move dialwithconfig to utils
Browse files Browse the repository at this point in the history
  • Loading branch information
cam-schultz committed Jun 10, 2024
1 parent c7ba691 commit 7f73574
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 105 deletions.
3 changes: 1 addition & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"github.com/ava-labs/avalanchego/utils/set"
"github.com/ava-labs/awm-relayer/utils"

clientUtils "github.com/ava-labs/awm-relayer/ethclient"
"github.com/ava-labs/subnet-evm/ethclient"
"github.com/ava-labs/subnet-evm/precompile/contracts/warp"

Expand Down Expand Up @@ -615,7 +614,7 @@ func (s *DestinationBlockchain) initializeWarpQuorum() error {
return fmt.Errorf("invalid subnetID in configuration. error: %w", err)
}

client, err := clientUtils.DialWithConfig(context.Background(), s.RPCEndpoint.BaseURL, s.RPCEndpoint.HTTPHeaders, s.RPCEndpoint.QueryParams)
client, err := utils.DialWithConfig(context.Background(), s.RPCEndpoint.BaseURL, s.RPCEndpoint.HTTPHeaders, s.RPCEndpoint.QueryParams)

Check failure on line 617 in config/config.go

View workflow job for this annotation

GitHub Actions / golangci

undefined: utils.DialWithConfig) (typecheck)

Check failure on line 617 in config/config.go

View workflow job for this annotation

GitHub Actions / golangci

undefined: utils.DialWithConfig) (typecheck)

Check failure on line 617 in config/config.go

View workflow job for this annotation

GitHub Actions / golangci

undefined: utils.DialWithConfig) (typecheck)

Check failure on line 617 in config/config.go

View workflow job for this annotation

GitHub Actions / golangci

undefined: utils.DialWithConfig) (typecheck)

Check failure on line 617 in config/config.go

View workflow job for this annotation

GitHub Actions / golangci

undefined: utils.DialWithConfig) (typecheck)

Check failure on line 617 in config/config.go

View workflow job for this annotation

GitHub Actions / Unit tests

undefined: utils.DialWithConfig
if err != nil {
return fmt.Errorf("failed to dial destination blockchain %s: %w", blockchainID, err)
}
Expand Down
52 changes: 0 additions & 52 deletions ethclient/client.go

This file was deleted.

45 changes: 0 additions & 45 deletions ethclient/client_test.go

This file was deleted.

3 changes: 1 addition & 2 deletions main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"github.com/ava-labs/avalanchego/utils/logging"
"github.com/ava-labs/awm-relayer/config"
"github.com/ava-labs/awm-relayer/database"
clientUtils "github.com/ava-labs/awm-relayer/ethclient"
"github.com/ava-labs/awm-relayer/peers"
"github.com/ava-labs/awm-relayer/relayer"
"github.com/ava-labs/awm-relayer/types"
Expand Down Expand Up @@ -243,7 +242,7 @@ func main() {
// errgroup will cancel the context when the first goroutine returns an error
errGroup.Go(func() error {
// Dial the eth client
ethClient, err := clientUtils.DialWithConfig(
ethClient, err := utils.DialWithConfig(
context.Background(),
sourceBlockchain.RPCEndpoint.BaseURL,
sourceBlockchain.RPCEndpoint.HTTPHeaders,
Expand Down
4 changes: 2 additions & 2 deletions relayer/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import (
"github.com/ava-labs/avalanchego/utils/logging"
"github.com/ava-labs/awm-relayer/config"
"github.com/ava-labs/awm-relayer/database"
clientUtils "github.com/ava-labs/awm-relayer/ethclient"
"github.com/ava-labs/awm-relayer/messages"
offchainregistry "github.com/ava-labs/awm-relayer/messages/off-chain-registry"
"github.com/ava-labs/awm-relayer/messages/teleporter"
relayerTypes "github.com/ava-labs/awm-relayer/types"
"github.com/ava-labs/awm-relayer/utils"
vms "github.com/ava-labs/awm-relayer/vms"
"github.com/ava-labs/subnet-evm/ethclient"
"github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -66,7 +66,7 @@ func NewListener(
)
return nil, err
}
ethWSClient, err := clientUtils.DialWithConfig(
ethWSClient, err := utils.DialWithConfig(
context.Background(),
sourceBlockchain.WSEndpoint.BaseURL,
sourceBlockchain.WSEndpoint.HTTPHeaders,
Expand Down
4 changes: 2 additions & 2 deletions vms/evm/destination_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/ava-labs/avalanchego/utils/logging"
avalancheWarp "github.com/ava-labs/avalanchego/vms/platformvm/warp"
"github.com/ava-labs/awm-relayer/config"
clientUtils "github.com/ava-labs/awm-relayer/ethclient"
"github.com/ava-labs/awm-relayer/utils"
"github.com/ava-labs/awm-relayer/vms/evm/signer"
"github.com/ava-labs/subnet-evm/core/types"
"github.com/ava-labs/subnet-evm/ethclient"
Expand Down Expand Up @@ -52,7 +52,7 @@ func NewDestinationClient(
destinationBlockchain *config.DestinationBlockchain,
) (*destinationClient, error) {
// Dial the destination RPC endpoint
client, err := clientUtils.DialWithConfig(
client, err := utils.DialWithConfig(
context.Background(),
destinationBlockchain.RPCEndpoint.BaseURL,
destinationBlockchain.RPCEndpoint.HTTPHeaders,
Expand Down

0 comments on commit 7f73574

Please sign in to comment.