Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
adamewozniak committed Sep 30, 2024
1 parent 7e73d40 commit 6ea5f0f
Show file tree
Hide file tree
Showing 41 changed files with 349 additions and 537 deletions.
8 changes: 4 additions & 4 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ import (
gmpkeeper "github.com/ojo-network/ojo/x/gmp/keeper"
gmptypes "github.com/ojo-network/ojo/x/gmp/types"

"github.com/ojo-network/ojo/x/gas_estimate"
gasestimatekeeper "github.com/ojo-network/ojo/x/gas_estimate/keeper"
gasestimatetypes "github.com/ojo-network/ojo/x/gas_estimate/types"
"github.com/ojo-network/ojo/x/gasestimate"
gasestimatekeeper "github.com/ojo-network/ojo/x/gasestimate/keeper"
gasestimatetypes "github.com/ojo-network/ojo/x/gasestimate/types"

"github.com/ojo-network/ojo/x/airdrop"
airdropkeeper "github.com/ojo-network/ojo/x/airdrop/keeper"
Expand Down Expand Up @@ -595,7 +595,7 @@ func New(
ibctm.NewAppModule(),
oracle.NewAppModule(appCodec, app.OracleKeeper, app.AccountKeeper, app.BankKeeper),
gmp.NewAppModule(appCodec, app.GmpKeeper, app.OracleKeeper),
gas_estimate.NewAppModule(appCodec, app.GasEstimateKeeper),
gasestimate.NewAppModule(appCodec, app.GasEstimateKeeper),
airdrop.NewAppModule(appCodec, app.AirdropKeeper, app.AccountKeeper, app.BankKeeper),
consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper),
)
Expand Down
4 changes: 2 additions & 2 deletions app/preblocker.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/ojo-network/ojo/x/oracle/abci"
"github.com/ojo-network/ojo/x/oracle/types"

gasestimatetypes "github.com/ojo-network/ojo/x/gas_estimate/types"
gasestimatetypes "github.com/ojo-network/ojo/x/gasestimate/types"
)

// PreBlocker is run before finalize block to update the aggregrate exchange rate votes on the oracle module
Expand Down Expand Up @@ -67,7 +67,7 @@ func (app *App) PreBlocker(ctx sdk.Context, req *cometabci.RequestFinalizeBlock)
GasEstimate: gasEstimate.GasEstimation,
})
}
app.Logger().Info("gas estimates updated", "gas_estimates", injectedVoteExtTx.GasEstimateMedians)
app.Logger().Info("gas estimates updated", "gasestimates", injectedVoteExtTx.GasEstimateMedians)
}
}
}
Expand Down
34 changes: 0 additions & 34 deletions proto/ojo/gas_estimate/v1/gas_estimate.proto

This file was deleted.

12 changes: 0 additions & 12 deletions proto/ojo/gas_estimate/v1/genesis.proto

This file was deleted.

30 changes: 30 additions & 0 deletions proto/ojo/gasestimate/v1/gasestimate.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
syntax = "proto3";
package ojo.gasestimate.v1;

import "gogoproto/gogo.proto";

option go_package = "github.com/ojo-network/ojo/x/gasestimate/types";

option (gogoproto.goproto_getters_all) = false;

// Params defines the parameters for the gasestimate module.
message Params {
// The contracts we'll send gasestimate messages to.
repeated Contract contract_registry = 1;
// The gas limit for the gasestimate messages. E.x., "1000000"
string gas_limit = 2;
// The gas adjustment multiplier for the gasestimate messages. E.x., "1.5"
string gas_adjustment = 3;
}

// Contract defines a contract that we
message Contract {
string address = 1;
string network = 2;
}

// GasEstimate is the gas estimate for a given network.
message GasEstimate {
string network = 1;
int64 gas_estimate = 2;
}
12 changes: 12 additions & 0 deletions proto/ojo/gasestimate/v1/genesis.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
syntax = "proto3";
package ojo.gasestimate.v1;

import "gogoproto/gogo.proto";
import "ojo/gasestimate/v1/gasestimate.proto";

option go_package = "github.com/ojo-network/ojo/x/gasestimate/types";

// GenesisState represents the genesis state of the gasestimate module.
message GenesisState {
Params params = 1 [ (gogoproto.nullable) = false ];
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
syntax = "proto3";
package ojo.gas_estimate.v1;
package ojo.gasestimate.v1;

import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "ojo/gas_estimate/v1/gas_estimate.proto";
import "ojo/gasestimate/v1/gasestimate.proto";

option go_package = "github.com/ojo-network/ojo/x/gas_estimate/types";
option go_package = "github.com/ojo-network/ojo/x/gasestimate/types";

// Query defines the gRPC querier service for the gas_estimate module
// Query defines the gRPC querier service for the gasestimate module
service Query {
// Params queries all parameters.
rpc Params(ParamsRequest) returns (ParamsResponse) {
option (google.api.http).get = "/ojo/gas_estimate/v1/params";
option (google.api.http).get = "/ojo/gasestimate/v1/params";
}
// GasEstimate queries the gas estimate for a given network.
rpc GasEstimate(GasEstimateRequest) returns (GasEstimateResponse) {
option (google.api.http).get = "/ojo/gas_estimate/v1/gas_estimate";
option (google.api.http).get = "/ojo/gasestimate/v1/gasestimate";
}
}

Expand All @@ -27,10 +28,12 @@ message ParamsResponse {
Params params = 1 [(gogoproto.nullable) = false];
}

// GasEstimateRequest is the request type for the Query/GasEstimate RPC method.
message GasEstimateRequest {
string network = 1;
}

// GasEstimateResponse is the response type for the Query/GasEstimate RPC method.
message GasEstimateResponse {
int64 gas_estimate = 1;
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
syntax = "proto3";
package ojo.gas_estimate.v1;
package ojo.gasestimate.v1;

import "gogoproto/gogo.proto";
import "ojo/gas_estimate/v1/gas_estimate.proto";
import "ojo/gasestimate/v1/gasestimate.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/msg/v1/msg.proto";
import "cosmos/base/v1beta1/coin.proto";

Check failure on line 8 in proto/ojo/gasestimate/v1/tx.proto

View workflow job for this annotation

GitHub Actions / buf-lint

Import "cosmos/base/v1beta1/coin.proto" is unused.

option go_package = "github.com/ojo-network/ojo/x/gas_estimate/types";
option go_package = "github.com/ojo-network/ojo/x/gasestimate/types";

// Msg defines the gas_estimate Msg service.
// Msg defines the gasestimate Msg service.
service Msg {
// SetParams sets the parameters for the gas_estimate module.
// SetParams sets the parameters for the gasestimate module.
rpc SetParams(MsgSetParams) returns (MsgSetParamsResponse);
}

Expand All @@ -24,7 +24,7 @@ message MsgSetParams {
// authority is the address that controls the module (defaults to x/gov unless overwritten).
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];

// params defines the gas_estimate parameters to update.
// params defines the gasestimate parameters to update.
Params params = 2;
}

Expand Down
23 changes: 0 additions & 23 deletions proto/ojo/gmp/v1/abci.proto

This file was deleted.

3 changes: 3 additions & 0 deletions proto/ojo/gmp/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ service Query {
option (google.api.http).get = "/ojo/gmp/v1/params";
}

// AllPayments queries all payments.
rpc AllPayments(AllPaymentsRequest) returns (AllPaymentsResponse) {
option (google.api.http).get = "/ojo/gmp/v1/all_payments";
}
Expand All @@ -28,8 +29,10 @@ message ParamsResponse {
Params params = 1 [(gogoproto.nullable) = false];
}

// AllPaymentsRequest is the request type for the Query/AllPayments RPC method.
message AllPaymentsRequest {}

// AllPaymentsResponse is the response type for the Query/AllPayments RPC method.
message AllPaymentsResponse {
repeated Payment payments = 1 [(gogoproto.nullable) = false];
}
4 changes: 2 additions & 2 deletions x/gas_estimate/abci.go → x/gasestimate/abci.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package gas_estimate
package gasestimate

import (
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/ojo-network/ojo/x/gas_estimate/keeper"
"github.com/ojo-network/ojo/x/gasestimate/keeper"
)

// EndBlocker is called at the end of every block
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/ojo-network/ojo/util/cli"
"github.com/ojo-network/ojo/x/gas_estimate/types"
"github.com/ojo-network/ojo/x/gasestimate/types"
"github.com/spf13/cobra"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

"github.com/cosmos/cosmos-sdk/client"
"github.com/ojo-network/ojo/x/gas_estimate/types"
"github.com/ojo-network/ojo/x/gasestimate/types"
"github.com/spf13/cobra"
)

Expand All @@ -17,8 +17,7 @@ func GetTxCmd() *cobra.Command {
RunE: client.ValidateCmd,
}

cmd.AddCommand(
)
cmd.AddCommand()

return cmd
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ func (s *IntegrationTestSuite) TearDownSuite() {
s.network.Cleanup()
}

// TODO: Fix tx raw log not having "no gas_estimate account found" message in it.
// TODO: Fix tx raw log not having "no gasestimate account found" message in it.
// Ref: https://github.com/ojo-network/ojo/issues/308
func (s *IntegrationTestSuite) TestRelaygas_estimate() {
func (s *IntegrationTestSuite) TestRelaygasestimate() {
s.T().Skip()

// val := s.network.Validators[0]
Expand Down Expand Up @@ -73,7 +73,7 @@ func (s *IntegrationTestSuite) TestRelaygas_estimate() {
s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), tc.respType), out.String())
txResp := tc.respType.(*sdk.TxResponse)
s.Require().Contains(txResp.RawLog, "unable to relay to gas_estimate")
s.Require().Contains(txResp.RawLog, "unable to relay to gasestimate")
}*/
})
}
Expand Down
10 changes: 5 additions & 5 deletions x/gas_estimate/genesis.go → x/gasestimate/genesis.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
package gas_estimate
package gasestimate

import (
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/ojo-network/ojo/x/gas_estimate/keeper"
"github.com/ojo-network/ojo/x/gas_estimate/types"
"github.com/ojo-network/ojo/x/gasestimate/keeper"
"github.com/ojo-network/ojo/x/gasestimate/types"
)

// InitGenesis initializes the x/gas_estimate module's state from a provided genesis
// InitGenesis initializes the x/gasestimate module's state from a provided genesis
// state.
func InitGenesis(ctx sdk.Context, keeper keeper.Keeper, genState types.GenesisState) {
keeper.SetParams(ctx, genState.Params)
}

// ExportGenesis returns the x/gas_estimate module's exported genesis.
// ExportGenesis returns the x/gasestimate module's exported genesis.
func ExportGenesis(ctx sdk.Context, keeper keeper.Keeper) *types.GenesisState {
genesisState := types.DefaultGenesisState()
genesisState.Params = keeper.GetParams(ctx)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ import (

sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/ojo-network/ojo/x/gas_estimate/types"
"github.com/ojo-network/ojo/x/gasestimate/types"
)

var _ types.QueryServer = querier{}

// Querier implements a QueryServer for the x/gas_estimate module.
// Querier implements a QueryServer for the x/gasestimate module.
type querier struct {
Keeper
}

// NewQuerier returns an implementation of the gas_estimate QueryServer interface
// NewQuerier returns an implementation of the gasestimate QueryServer interface
// for the provided Keeper.
func NewQuerier(keeper Keeper) types.QueryServer {
return &querier{Keeper: keeper}
}

// Params queries params of x/gas_estimate module.
// Params queries params of x/gasestimate module.
func (q querier) Params(
goCtx context.Context,
_ *types.ParamsRequest,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
storetypes "cosmossdk.io/store/types"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/ojo-network/ojo/app/ibctransfer"
"github.com/ojo-network/ojo/x/gas_estimate/types"
"github.com/ojo-network/ojo/x/gasestimate/types"
)

type Keeper struct {
Expand All @@ -23,7 +23,7 @@ type Keeper struct {
authority string
}

// NewKeeper constructs a new keeper for gas_estimate module.
// NewKeeper constructs a new keeper for gasestimate module.
func NewKeeper(
cdc codec.BinaryCodec,
storeKey storetypes.StoreKey,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
ojoapp "github.com/ojo-network/ojo/app"
appparams "github.com/ojo-network/ojo/app/params"
"github.com/ojo-network/ojo/tests/integration"
"github.com/ojo-network/ojo/x/gas_estimate/keeper"
"github.com/ojo-network/ojo/x/gas_estimate/types"
"github.com/ojo-network/ojo/x/gasestimate/keeper"
"github.com/ojo-network/ojo/x/gasestimate/types"
)

const (
Expand Down
Loading

0 comments on commit 6ea5f0f

Please sign in to comment.