Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
gartnera committed Aug 29, 2024
1 parent 3025cde commit aaadc78
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 28 deletions.
7 changes: 5 additions & 2 deletions cmd/zetae2e/config/clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import (
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/gagliardetto/solana-go/rpc"
zetacore_rpc "github.com/zeta-chain/zetacore/pkg/rpc"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"

"github.com/zeta-chain/zetacore/e2e/config"
"github.com/zeta-chain/zetacore/e2e/runner"
zetacore_rpc "github.com/zeta-chain/zetacore/pkg/rpc"
)

// getClientsFromConfig get clients from config
Expand Down Expand Up @@ -108,7 +108,10 @@ func getEVMClient(

func GetZetacoreClient(ctx context.Context, conf config.Config) (zetacore_rpc.Clients, error) {

Check failure on line 109 in cmd/zetae2e/config/clients.go

View workflow job for this annotation

GitHub Actions / lint

unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
if conf.RPCs.ZetaCoreGRPC != "" {
return zetacore_rpc.NewGRPCClients(conf.RPCs.ZetaCoreGRPC, grpc.WithTransportCredentials(insecure.NewCredentials()))
return zetacore_rpc.NewGRPCClients(
conf.RPCs.ZetaCoreGRPC,
grpc.WithTransportCredentials(insecure.NewCredentials()),
)
}
if conf.RPCs.ZetaCoreRPC != "" {
return zetacore_rpc.NewCometBFTClients(conf.RPCs.ZetaCoreRPC)
Expand Down
1 change: 1 addition & 0 deletions e2e/runner/clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/gagliardetto/solana-go/rpc"

zetacore_rpc "github.com/zeta-chain/zetacore/pkg/rpc"
)

Expand Down
4 changes: 3 additions & 1 deletion pkg/rpc/clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
feemarkettypes "github.com/zeta-chain/ethermint/x/feemarket/types"
"google.golang.org/grpc"

feemarkettypes "github.com/zeta-chain/ethermint/x/feemarket/types"
etherminttypes "github.com/zeta-chain/zetacore/rpc/types"
authoritytypes "github.com/zeta-chain/zetacore/x/authority/types"
crosschaintypes "github.com/zeta-chain/zetacore/x/crosschain/types"
Expand All @@ -21,6 +21,8 @@ import (
)

// Clients contains RPC client interfaces to interact with ZetaCore
//
// Clients also has some high level wrappers for the clients
type Clients struct {
// Cosmos SDK clients

Expand Down
25 changes: 0 additions & 25 deletions pkg/rpc/clients_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"

abci "github.com/cometbft/cometbft/abci/types"
tmtypes "github.com/cometbft/cometbft/proto/tendermint/types"
"github.com/cosmos/cosmos-sdk/client/grpc/tmservice"
"github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/query"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -72,29 +70,6 @@ func setupMockServer(
return server
}

func withDummyServer(zetaBlockHeight int64) []grpcmock.ServerOption {
return []grpcmock.ServerOption{
grpcmock.RegisterService(crosschaintypes.RegisterQueryServer),
grpcmock.RegisterService(crosschaintypes.RegisterMsgServer),
grpcmock.RegisterService(feemarkettypes.RegisterQueryServer),
grpcmock.RegisterService(authtypes.RegisterQueryServer),
grpcmock.RegisterService(abci.RegisterABCIApplicationServer),
func(s *grpcmock.Server) {
// Block Height
s.ExpectUnary("/zetachain.zetacore.crosschain.Query/LastZetaHeight").
UnlimitedTimes().
Return(crosschaintypes.QueryLastZetaHeightResponse{Height: zetaBlockHeight})

// London Base Fee
s.ExpectUnary("/ethermint.feemarket.v1.Query/Params").
UnlimitedTimes().
Return(feemarkettypes.QueryParamsResponse{
Params: feemarkettypes.Params{BaseFee: types.NewInt(100)},
})
},
}
}

func setupZetacoreClients(t *testing.T) Clients {
c, err := NewGRPCClients(gRPCListenPath, grpc.WithTransportCredentials(insecure.NewCredentials()))

Expand Down

0 comments on commit aaadc78

Please sign in to comment.