diff --git a/app/app.go b/app/app.go index 29fd9cb2..c69e14b3 100644 --- a/app/app.go +++ b/app/app.go @@ -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" @@ -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), ) diff --git a/app/preblocker.go b/app/preblocker.go index 8de822a6..c1ad10e2 100644 --- a/app/preblocker.go +++ b/app/preblocker.go @@ -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 @@ -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) } } } diff --git a/proto/ojo/gas_estimate/v1/gas_estimate.proto b/proto/ojo/gas_estimate/v1/gas_estimate.proto deleted file mode 100644 index 1e5b38d0..00000000 --- a/proto/ojo/gas_estimate/v1/gas_estimate.proto +++ /dev/null @@ -1,34 +0,0 @@ -syntax = "proto3"; -package ojo.gas_estimate.v1; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; - -option go_package = "github.com/ojo-network/ojo/x/gas_estimate/types"; - -option (gogoproto.goproto_getters_all) = false; - -// Params defines the parameters for the gas_estimate module. -message Params { - // The contracts we'll send gas_estimate messages to. - repeated Contract contract_registry = 1; - // The gas limit for the gas_estimate messages. E.x., "1000000" - string gas_limit = 2; - // The gas adjustment multiplier for the gas_estimate messages. E.x., "1.5" - string gas_adjustment = 3; -} - -// Contract defines a contract that we -message Contract { - string address = 1; - string network = 2; -} - -message GasEstimates { - repeated GasEstimate gas_estimates = 1; -} - -message GasEstimate { - string network = 1; - int64 gas_estimate = 2; -} diff --git a/proto/ojo/gas_estimate/v1/genesis.proto b/proto/ojo/gas_estimate/v1/genesis.proto deleted file mode 100644 index 5a824524..00000000 --- a/proto/ojo/gas_estimate/v1/genesis.proto +++ /dev/null @@ -1,12 +0,0 @@ -syntax = "proto3"; -package ojo.gas_estimate.v1; - -import "gogoproto/gogo.proto"; -import "ojo/gas_estimate/v1/gas_estimate.proto"; - -option go_package = "github.com/ojo-network/ojo/x/gas_estimate/types"; - -// GenesisState represents the genesis state of the gas_estimate module. -message GenesisState { - Params params = 1 [ (gogoproto.nullable) = false ]; -} diff --git a/proto/ojo/gasestimate/v1/gasestimate.proto b/proto/ojo/gasestimate/v1/gasestimate.proto new file mode 100644 index 00000000..61455391 --- /dev/null +++ b/proto/ojo/gasestimate/v1/gasestimate.proto @@ -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; +} diff --git a/proto/ojo/gasestimate/v1/genesis.proto b/proto/ojo/gasestimate/v1/genesis.proto new file mode 100644 index 00000000..a77c7426 --- /dev/null +++ b/proto/ojo/gasestimate/v1/genesis.proto @@ -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 ]; +} diff --git a/proto/ojo/gas_estimate/v1/query.proto b/proto/ojo/gasestimate/v1/query.proto similarity index 54% rename from proto/ojo/gas_estimate/v1/query.proto rename to proto/ojo/gasestimate/v1/query.proto index 4f958108..4a91ca57 100644 --- a/proto/ojo/gas_estimate/v1/query.proto +++ b/proto/ojo/gasestimate/v1/query.proto @@ -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"; } } @@ -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; } diff --git a/proto/ojo/gas_estimate/v1/tx.proto b/proto/ojo/gasestimate/v1/tx.proto similarity index 69% rename from proto/ojo/gas_estimate/v1/tx.proto rename to proto/ojo/gasestimate/v1/tx.proto index e6136e4a..beddbcfd 100644 --- a/proto/ojo/gas_estimate/v1/tx.proto +++ b/proto/ojo/gasestimate/v1/tx.proto @@ -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"; -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); } @@ -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; } diff --git a/proto/ojo/gmp/v1/abci.proto b/proto/ojo/gmp/v1/abci.proto deleted file mode 100644 index 36a1d510..00000000 --- a/proto/ojo/gmp/v1/abci.proto +++ /dev/null @@ -1,23 +0,0 @@ -syntax = "proto3"; -package ojo.gmp.v1; - -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; - -option go_package = "github.com/ojo-network/ojo/x/gmp/types"; - -option (gogoproto.goproto_getters_all) = false; - -// GmpVoteExtension defines the vote extension structure used by the gmp -// module. -message GmpVoteExtension { - int64 height = 1; - int64 gas_estimation = 2; -} - -// InjectedVoteExtensionTx defines the vote extension tx injected by the prepare -// proposal handler. -message InjectedVoteExtensionTx { - int64 median_gas_estimation = 1; - bytes extended_commit_info = 2; -} diff --git a/proto/ojo/gmp/v1/query.proto b/proto/ojo/gmp/v1/query.proto index 6894afed..f19a71e6 100644 --- a/proto/ojo/gmp/v1/query.proto +++ b/proto/ojo/gmp/v1/query.proto @@ -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"; } @@ -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]; } diff --git a/x/gas_estimate/abci.go b/x/gasestimate/abci.go similarity index 70% rename from x/gas_estimate/abci.go rename to x/gasestimate/abci.go index 19c97eb4..21e8c86e 100644 --- a/x/gas_estimate/abci.go +++ b/x/gasestimate/abci.go @@ -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 diff --git a/x/gas_estimate/client/cli/query.go b/x/gasestimate/client/cli/query.go similarity index 97% rename from x/gas_estimate/client/cli/query.go rename to x/gasestimate/client/cli/query.go index 7d076256..6790e79a 100644 --- a/x/gas_estimate/client/cli/query.go +++ b/x/gasestimate/client/cli/query.go @@ -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" ) diff --git a/x/gas_estimate/client/cli/tx.go b/x/gasestimate/client/cli/tx.go similarity index 86% rename from x/gas_estimate/client/cli/tx.go rename to x/gasestimate/client/cli/tx.go index df11b0b1..d57cf7ef 100644 --- a/x/gas_estimate/client/cli/tx.go +++ b/x/gasestimate/client/cli/tx.go @@ -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" ) @@ -17,8 +17,7 @@ func GetTxCmd() *cobra.Command { RunE: client.ValidateCmd, } - cmd.AddCommand( - ) + cmd.AddCommand() return cmd } diff --git a/x/gas_estimate/client/tests/cli_test.go b/x/gasestimate/client/tests/cli_test.go similarity index 100% rename from x/gas_estimate/client/tests/cli_test.go rename to x/gasestimate/client/tests/cli_test.go diff --git a/x/gas_estimate/client/tests/suite.go b/x/gasestimate/client/tests/suite.go similarity index 88% rename from x/gas_estimate/client/tests/suite.go rename to x/gasestimate/client/tests/suite.go index f967e768..35b84738 100644 --- a/x/gas_estimate/client/tests/suite.go +++ b/x/gasestimate/client/tests/suite.go @@ -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] @@ -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") }*/ }) } diff --git a/x/gas_estimate/genesis.go b/x/gasestimate/genesis.go similarity index 58% rename from x/gas_estimate/genesis.go rename to x/gasestimate/genesis.go index eaa8463d..b7ea1600 100644 --- a/x/gas_estimate/genesis.go +++ b/x/gasestimate/genesis.go @@ -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) diff --git a/x/gas_estimate/keeper/grpc_query.go b/x/gasestimate/keeper/grpc_query.go similarity index 76% rename from x/gas_estimate/keeper/grpc_query.go rename to x/gasestimate/keeper/grpc_query.go index ed2fe869..4cbf05d6 100644 --- a/x/gas_estimate/keeper/grpc_query.go +++ b/x/gasestimate/keeper/grpc_query.go @@ -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, diff --git a/x/gas_estimate/keeper/helper_test.go b/x/gasestimate/keeper/helper_test.go similarity index 100% rename from x/gas_estimate/keeper/helper_test.go rename to x/gasestimate/keeper/helper_test.go diff --git a/x/gas_estimate/keeper/keeper.go b/x/gasestimate/keeper/keeper.go similarity index 93% rename from x/gas_estimate/keeper/keeper.go rename to x/gasestimate/keeper/keeper.go index 12a5e33b..faa71e70 100644 --- a/x/gas_estimate/keeper/keeper.go +++ b/x/gasestimate/keeper/keeper.go @@ -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 { @@ -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, diff --git a/x/gas_estimate/keeper/keeper_suite_test.go b/x/gasestimate/keeper/keeper_suite_test.go similarity index 88% rename from x/gas_estimate/keeper/keeper_suite_test.go rename to x/gasestimate/keeper/keeper_suite_test.go index cc5ebe8f..98672690 100644 --- a/x/gas_estimate/keeper/keeper_suite_test.go +++ b/x/gasestimate/keeper/keeper_suite_test.go @@ -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 ( diff --git a/x/gas_estimate/keeper/msg_server.go b/x/gasestimate/keeper/msg_server.go similarity index 81% rename from x/gas_estimate/keeper/msg_server.go rename to x/gasestimate/keeper/msg_server.go index ebaf82e7..37facfa4 100644 --- a/x/gas_estimate/keeper/msg_server.go +++ b/x/gasestimate/keeper/msg_server.go @@ -7,21 +7,21 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/ojo-network/ojo/x/gas_estimate/types" + "github.com/ojo-network/ojo/x/gasestimate/types" ) type msgServer struct { keeper Keeper } -// NewMsgServerImpl returns an implementation of the gas_estimate MsgServer interface +// NewMsgServerImpl returns an implementation of the gasestimate MsgServer interface // for the provided Keeper. func NewMsgServerImpl(keeper Keeper) types.MsgServer { return &msgServer{keeper: keeper} } // SetParams implements MsgServer.SetParams method. -// It defines a method to update the x/gas_estimate module parameters. +// It defines a method to update the x/gasestimate module parameters. func (ms msgServer) SetParams(goCtx context.Context, msg *types.MsgSetParams) (*types.MsgSetParamsResponse, error) { if ms.keeper.authority != msg.Authority { err := errors.Wrapf( diff --git a/x/gas_estimate/keeper/msg_server_test.go b/x/gasestimate/keeper/msg_server_test.go similarity index 71% rename from x/gas_estimate/keeper/msg_server_test.go rename to x/gasestimate/keeper/msg_server_test.go index 7fba09e6..6c4a2c7f 100644 --- a/x/gas_estimate/keeper/msg_server_test.go +++ b/x/gasestimate/keeper/msg_server_test.go @@ -5,7 +5,7 @@ import ( "github.com/cometbft/cometbft/crypto/secp256k1" sdk "github.com/cosmos/cosmos-sdk/types" appparams "github.com/ojo-network/ojo/app/params" - "github.com/ojo-network/ojo/x/gas_estimate/types" + "github.com/ojo-network/ojo/x/gasestimate/types" ) var ( @@ -15,23 +15,23 @@ var ( ) func (s *IntegrationTestSuite) TestMsgServer_SetParams() { - gas_estimateChannel := "channel-1" - gas_estimateAddress := "axelar1dv4u5k73pzqrxlzujxg3qp8kvc3pje7jtdvu72npnt5zhq05ejcsn5qme5" + gasestimateChannel := "channel-1" + gasestimateAddress := "axelar1dv4u5k73pzqrxlzujxg3qp8kvc3pje7jtdvu72npnt5zhq05ejcsn5qme5" timeout := int64(1) feeRecipient := "axelar1zl3rxpp70lmte2xr6c4lgske2fyuj3hupcsvcd" - SetParams(s, gas_estimateAddress, gas_estimateChannel, timeout, feeRecipient) + SetParams(s, gasestimateAddress, gasestimateChannel, timeout, feeRecipient) params := types.DefaultParams() s.Require().Equal(params, s.app.GasEstimateKeeper.GetParams(s.ctx)) } -// SetParams sets the gas_estimate module params +// SetParams sets the gasestimate module params func SetParams( s *IntegrationTestSuite, - gas_estimateAddress string, - gas_estimateChannel string, - gas_estimateTimeout int64, + gasestimateAddress string, + gasestimateChannel string, + gasestimateTimeout int64, feeRecipient string, ) { params := types.DefaultParams() diff --git a/x/gas_estimate/keeper/params.go b/x/gasestimate/keeper/params.go similarity index 71% rename from x/gas_estimate/keeper/params.go rename to x/gasestimate/keeper/params.go index b93be92e..82880153 100644 --- a/x/gas_estimate/keeper/params.go +++ b/x/gasestimate/keeper/params.go @@ -2,16 +2,16 @@ package keeper 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" ) -// SetParams sets the gas_estimate module's parameters. +// SetParams sets the gasestimate module's parameters. func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { store := ctx.KVStore(k.storeKey) store.Set(types.ParamsKey, k.cdc.MustMarshal(¶ms)) } -// GetParams gets the gas_estimate module's parameters. +// GetParams gets the gasestimate module's parameters. func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) { store := ctx.KVStore(k.storeKey) bz := store.Get(types.ParamsKey) diff --git a/x/gas_estimate/keeper/params_test.go b/x/gasestimate/keeper/params_test.go similarity index 86% rename from x/gas_estimate/keeper/params_test.go rename to x/gasestimate/keeper/params_test.go index 7305a80d..1948a51a 100644 --- a/x/gas_estimate/keeper/params_test.go +++ b/x/gasestimate/keeper/params_test.go @@ -1,6 +1,6 @@ package keeper_test -import "github.com/ojo-network/ojo/x/gas_estimate/types" +import "github.com/ojo-network/ojo/x/gasestimate/types" func (s *IntegrationTestSuite) TestSetAndGetParams() { app, ctx := s.app, s.ctx diff --git a/x/gas_estimate/module.go b/x/gasestimate/module.go similarity index 78% rename from x/gas_estimate/module.go rename to x/gasestimate/module.go index b29f0471..527d4d7a 100644 --- a/x/gas_estimate/module.go +++ b/x/gasestimate/module.go @@ -1,4 +1,4 @@ -package gas_estimate +package gasestimate import ( "context" @@ -16,9 +16,9 @@ import ( "github.com/spf13/cobra" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/ojo-network/ojo/x/gas_estimate/client/cli" - "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/client/cli" + "github.com/ojo-network/ojo/x/gasestimate/keeper" + "github.com/ojo-network/ojo/x/gasestimate/types" ) var ( @@ -27,12 +27,12 @@ var ( _ module.AppModuleSimulation = AppModule{} ) -// AppModuleBasic implements the AppModuleBasic interface for the x/gas_estimate module. +// AppModuleBasic implements the AppModuleBasic interface for the x/gasestimate module. type AppModuleBasic struct { cdc codec.Codec } -// RegisterLegacyAminoCodec registers the x/gas_estimate module's types with a legacy +// RegisterLegacyAminoCodec registers the x/gasestimate module's types with a legacy // Amino codec. func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { types.RegisterLegacyAminoCodec(cdc) @@ -42,7 +42,7 @@ func NewAppModuleBasic(cdc codec.Codec) AppModuleBasic { return AppModuleBasic{cdc: cdc} } -// Name returns the x/gas_estimate module's name. +// Name returns the x/gasestimate module's name. func (AppModuleBasic) Name() string { return types.ModuleName } @@ -57,17 +57,17 @@ func (AppModuleBasic) ConsensusVersion() uint64 { return 1 } -// RegisterInterfaces registers the x/gas_estimate module's interface types. +// RegisterInterfaces registers the x/gasestimate module's interface types. func (AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { types.RegisterInterfaces(reg) } -// DefaultGenesis returns the x/gas_estimate module's default genesis state. +// DefaultGenesis returns the x/gasestimate module's default genesis state. func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { return cdc.MustMarshalJSON(types.DefaultGenesisState()) } -// ValidateGenesis performs genesis state validation for the x/gas_estimate module. +// ValidateGenesis performs genesis state validation for the x/gasestimate module. func (AppModuleBasic) ValidateGenesis( cdc codec.JSONCodec, _ client.TxEncodingConfig, @@ -85,7 +85,7 @@ func (AppModuleBasic) ValidateGenesis( // gRPC service. func (AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) {} -// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the x/gas_estimate +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the x/gasestimate // module. func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { @@ -93,17 +93,17 @@ func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *r } } -// GetTxCmd returns the x/gas_estimate module's root tx command. +// GetTxCmd returns the x/gasestimate module's root tx command. func (AppModuleBasic) GetTxCmd() *cobra.Command { return cli.GetTxCmd() } -// GetQueryCmd returns the x/gas_estimate module's root query command. +// GetQueryCmd returns the x/gasestimate module's root query command. func (AppModuleBasic) GetQueryCmd() *cobra.Command { return cli.GetQueryCmd() } -// AppModule implements the AppModule interface for the x/gas_estimate module. +// AppModule implements the AppModule interface for the x/gasestimate module. type AppModule struct { AppModuleBasic @@ -120,12 +120,12 @@ func NewAppModule( } } -// Name returns the x/gas_estimate module's name. +// Name returns the x/gasestimate module's name. func (am AppModule) Name() string { return am.AppModuleBasic.Name() } -// QuerierRoute returns the x/gas_estimate module's query routing key. +// QuerierRoute returns the x/gasestimate module's query routing key. func (AppModule) QuerierRoute() string { return types.QuerierRoute } // RegisterServices registers gRPC services. @@ -134,10 +134,10 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterQueryServer(cfg.QueryServer(), keeper.NewQuerier(am.keeper)) } -// RegisterInvariants registers the x/gas_estimate module's invariants. +// RegisterInvariants registers the x/gasestimate module's invariants. func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} -// InitGenesis performs the x/gas_estimate module's genesis initialization. It returns +// InitGenesis performs the x/gasestimate module's genesis initialization. It returns // no validator updates. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { var genState types.GenesisState @@ -148,17 +148,17 @@ func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.Ra return []abci.ValidatorUpdate{} } -// ExportGenesis returns the x/gas_estimate module's exported genesis state as raw +// ExportGenesis returns the x/gasestimate module's exported genesis state as raw // JSON bytes. func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { genState := ExportGenesis(ctx, am.keeper) return cdc.MustMarshalJSON(genState) } -// BeginBlock executes all ABCI BeginBlock logic respective to the x/gas_estimate module. +// BeginBlock executes all ABCI BeginBlock logic respective to the x/gasestimate module. func (am AppModule) BeginBlock(_ context.Context) {} -// EndBlock is a no-op for the gas_estimate module. +// EndBlock is a no-op for the gasestimate module. func (am AppModule) EndBlock(goCtx context.Context) ([]abci.ValidatorUpdate, error) { return []abci.ValidatorUpdate{}, nil } @@ -171,7 +171,7 @@ func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.Weig return []simtypes.WeightedOperation{} } -// ProposalContents returns all the gas_estimate content functions used to +// ProposalContents returns all the gasestimate content functions used to // simulate governance proposals. func (am AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalMsg { return []simtypes.WeightedProposalMsg{} diff --git a/x/gas_estimate/types/codec.go b/x/gasestimate/types/codec.go similarity index 74% rename from x/gas_estimate/types/codec.go rename to x/gasestimate/types/codec.go index 57254f2a..ec9de8c8 100644 --- a/x/gas_estimate/types/codec.go +++ b/x/gasestimate/types/codec.go @@ -11,7 +11,7 @@ import ( var ( amino = codec.NewLegacyAmino() - // ModuleCdc references the global x/gas_estimate module codec. Note, the codec should + // ModuleCdc references the global x/gasestimate module codec. Note, the codec should // ONLY be used in certain instances of tests and for JSON encoding as Amino is // still used for that purpose. // @@ -26,13 +26,13 @@ func init() { amino.Seal() } -// RegisterLegacyAminoCodec registers the necessary x/gas_estimate interfaces and concrete types +// RegisterLegacyAminoCodec registers the necessary x/gasestimate interfaces and concrete types // on the provided LegacyAmino codec. These types are used for Amino JSON serialization. func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - cdc.RegisterConcrete(&MsgSetParams{}, "ojo/gas_estimate/MsgSetParams", nil) + cdc.RegisterConcrete(&MsgSetParams{}, "ojo/gasestimate/MsgSetParams", nil) } -// RegisterInterfaces registers the x/gas_estimate interfaces types with the interface registry +// RegisterInterfaces registers the x/gasestimate interfaces types with the interface registry func RegisterInterfaces(registry codectypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSetParams{}, diff --git a/x/gas_estimate/types/errors.go b/x/gasestimate/types/errors.go similarity index 100% rename from x/gas_estimate/types/errors.go rename to x/gasestimate/types/errors.go diff --git a/x/gas_estimate/types/expected_keeper.go b/x/gasestimate/types/expected_keeper.go similarity index 100% rename from x/gas_estimate/types/expected_keeper.go rename to x/gasestimate/types/expected_keeper.go diff --git a/x/gas_estimate/types/gas_estimate.pb.go b/x/gasestimate/types/gasestimate.pb.go similarity index 61% rename from x/gas_estimate/types/gas_estimate.pb.go rename to x/gasestimate/types/gasestimate.pb.go index ace6a604..f3976235 100644 --- a/x/gas_estimate/types/gas_estimate.pb.go +++ b/x/gasestimate/types/gasestimate.pb.go @@ -1,11 +1,10 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: ojo/gas_estimate/v1/gas_estimate.proto +// source: ojo/gasestimate/v1/gasestimate.proto package types import ( fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types" proto "github.com/cosmos/gogoproto/proto" _ "github.com/gogo/protobuf/gogoproto" io "io" @@ -24,13 +23,13 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// Params defines the parameters for the gas_estimate module. +// Params defines the parameters for the gasestimate module. type Params struct { - // The contracts we'll send gas_estimate messages to. + // The contracts we'll send gasestimate messages to. ContractRegistry []*Contract `protobuf:"bytes,1,rep,name=contract_registry,json=contractRegistry,proto3" json:"contract_registry,omitempty"` - // The gas limit for the gas_estimate messages. E.x., "1000000" + // The gas limit for the gasestimate messages. E.x., "1000000" GasLimit string `protobuf:"bytes,2,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"` - // The gas adjustment multiplier for the gas_estimate messages. E.x., "1.5" + // The gas adjustment multiplier for the gasestimate messages. E.x., "1.5" GasAdjustment string `protobuf:"bytes,3,opt,name=gas_adjustment,json=gasAdjustment,proto3" json:"gas_adjustment,omitempty"` } @@ -38,7 +37,7 @@ func (m *Params) Reset() { *m = Params{} } func (m *Params) String() string { return proto.CompactTextString(m) } func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_2ab0542009df893d, []int{0} + return fileDescriptor_6d6bf005bd9acf66, []int{0} } func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -77,7 +76,7 @@ func (m *Contract) Reset() { *m = Contract{} } func (m *Contract) String() string { return proto.CompactTextString(m) } func (*Contract) ProtoMessage() {} func (*Contract) Descriptor() ([]byte, []int) { - return fileDescriptor_2ab0542009df893d, []int{1} + return fileDescriptor_6d6bf005bd9acf66, []int{1} } func (m *Contract) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -106,43 +105,7 @@ func (m *Contract) XXX_DiscardUnknown() { var xxx_messageInfo_Contract proto.InternalMessageInfo -type GasEstimates struct { - GasEstimates []*GasEstimate `protobuf:"bytes,1,rep,name=gas_estimates,json=gasEstimates,proto3" json:"gas_estimates,omitempty"` -} - -func (m *GasEstimates) Reset() { *m = GasEstimates{} } -func (m *GasEstimates) String() string { return proto.CompactTextString(m) } -func (*GasEstimates) ProtoMessage() {} -func (*GasEstimates) Descriptor() ([]byte, []int) { - return fileDescriptor_2ab0542009df893d, []int{2} -} -func (m *GasEstimates) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GasEstimates) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GasEstimates.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GasEstimates) XXX_Merge(src proto.Message) { - xxx_messageInfo_GasEstimates.Merge(m, src) -} -func (m *GasEstimates) XXX_Size() int { - return m.Size() -} -func (m *GasEstimates) XXX_DiscardUnknown() { - xxx_messageInfo_GasEstimates.DiscardUnknown(m) -} - -var xxx_messageInfo_GasEstimates proto.InternalMessageInfo - +// GasEstimate is the gas estimate for a given network. type GasEstimate struct { Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` GasEstimate int64 `protobuf:"varint,2,opt,name=gas_estimate,json=gasEstimate,proto3" json:"gas_estimate,omitempty"` @@ -152,7 +115,7 @@ func (m *GasEstimate) Reset() { *m = GasEstimate{} } func (m *GasEstimate) String() string { return proto.CompactTextString(m) } func (*GasEstimate) ProtoMessage() {} func (*GasEstimate) Descriptor() ([]byte, []int) { - return fileDescriptor_2ab0542009df893d, []int{3} + return fileDescriptor_6d6bf005bd9acf66, []int{2} } func (m *GasEstimate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -182,41 +145,37 @@ func (m *GasEstimate) XXX_DiscardUnknown() { var xxx_messageInfo_GasEstimate proto.InternalMessageInfo func init() { - proto.RegisterType((*Params)(nil), "ojo.gas_estimate.v1.Params") - proto.RegisterType((*Contract)(nil), "ojo.gas_estimate.v1.Contract") - proto.RegisterType((*GasEstimates)(nil), "ojo.gas_estimate.v1.GasEstimates") - proto.RegisterType((*GasEstimate)(nil), "ojo.gas_estimate.v1.GasEstimate") + proto.RegisterType((*Params)(nil), "ojo.gasestimate.v1.Params") + proto.RegisterType((*Contract)(nil), "ojo.gasestimate.v1.Contract") + proto.RegisterType((*GasEstimate)(nil), "ojo.gasestimate.v1.GasEstimate") } func init() { - proto.RegisterFile("ojo/gas_estimate/v1/gas_estimate.proto", fileDescriptor_2ab0542009df893d) -} - -var fileDescriptor_2ab0542009df893d = []byte{ - // 356 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x52, 0xc1, 0x4a, 0xeb, 0x40, - 0x14, 0xcd, 0xbc, 0x42, 0x5f, 0x3b, 0x6d, 0x1f, 0xef, 0xe5, 0xb9, 0x08, 0x15, 0x87, 0x1a, 0x50, - 0xba, 0x31, 0x43, 0x75, 0x2f, 0xa8, 0x14, 0xa1, 0x28, 0x48, 0xc0, 0x8d, 0x9b, 0x32, 0x49, 0x87, - 0x31, 0xd1, 0xe4, 0x96, 0xdc, 0x69, 0xb5, 0x7f, 0xe1, 0xd2, 0x4f, 0xea, 0xb2, 0x4b, 0x97, 0xda, - 0xfe, 0x88, 0x24, 0x4d, 0x24, 0x81, 0xee, 0xee, 0xb9, 0xe7, 0xdc, 0x73, 0xee, 0x65, 0x86, 0x1e, - 0x43, 0x08, 0x5c, 0x09, 0x1c, 0x4b, 0xd4, 0x41, 0x24, 0xb4, 0xe4, 0xf3, 0x41, 0x05, 0x3b, 0xd3, - 0x04, 0x34, 0x98, 0xff, 0x21, 0x04, 0xa7, 0xd2, 0x9f, 0x0f, 0xba, 0x7b, 0x0a, 0x14, 0x64, 0x3c, - 0x4f, 0xab, 0xad, 0xb4, 0xcb, 0x7c, 0xc0, 0x08, 0x90, 0x7b, 0x02, 0x53, 0x37, 0x4f, 0x6a, 0x31, - 0xe0, 0x3e, 0x04, 0xf1, 0x96, 0xb7, 0xdf, 0x09, 0xad, 0xdf, 0x89, 0x44, 0x44, 0x68, 0x8e, 0xe8, - 0x3f, 0x1f, 0x62, 0x9d, 0x08, 0x5f, 0x8f, 0x13, 0xa9, 0x02, 0xd4, 0xc9, 0xc2, 0x22, 0xbd, 0x5a, - 0xbf, 0x75, 0x7a, 0xe0, 0xec, 0x48, 0x74, 0xae, 0x72, 0xb5, 0xfb, 0xb7, 0x98, 0x73, 0xf3, 0x31, - 0x73, 0x9f, 0x36, 0x53, 0xf5, 0x73, 0x10, 0x05, 0xda, 0xfa, 0xd5, 0x23, 0xfd, 0xa6, 0xdb, 0x50, - 0x02, 0x6f, 0x52, 0x6c, 0x1e, 0xd1, 0x3f, 0x29, 0x29, 0x26, 0xe1, 0x0c, 0x75, 0x24, 0x63, 0x6d, - 0xd5, 0x32, 0x45, 0x47, 0x09, 0xbc, 0xf8, 0x69, 0xda, 0xe7, 0xb4, 0x51, 0x24, 0x98, 0x16, 0xfd, - 0x2d, 0x26, 0x93, 0x44, 0x22, 0x5a, 0x24, 0xd3, 0x16, 0x30, 0x65, 0x62, 0xa9, 0x5f, 0x20, 0x79, - 0xca, 0x73, 0x0a, 0x68, 0xdf, 0xd3, 0xf6, 0xb5, 0xc0, 0x61, 0xbe, 0x30, 0x9a, 0x43, 0xda, 0x29, - 0x5f, 0x80, 0xf9, 0x6d, 0xbd, 0x9d, 0xb7, 0x95, 0x26, 0xdd, 0xb6, 0x2a, 0xd9, 0xd8, 0x23, 0xda, - 0x2a, 0x91, 0xe5, 0x7c, 0x52, 0xc9, 0x37, 0x0f, 0x69, 0xbb, 0xec, 0x9a, 0xad, 0x57, 0x73, 0x5b, - 0x25, 0xb3, 0xcb, 0xdb, 0xe5, 0x17, 0x33, 0x96, 0x6b, 0x46, 0x56, 0x6b, 0x46, 0x3e, 0xd7, 0x8c, - 0xbc, 0x6d, 0x98, 0xb1, 0xda, 0x30, 0xe3, 0x63, 0xc3, 0x8c, 0x07, 0xae, 0x02, 0xfd, 0x38, 0xf3, - 0x1c, 0x1f, 0x22, 0x0e, 0x21, 0x9c, 0xe4, 0xc6, 0x69, 0xcd, 0x5f, 0xab, 0xff, 0x44, 0x2f, 0xa6, - 0x12, 0xbd, 0x7a, 0xf6, 0xa6, 0x67, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x93, 0xc7, 0xd4, 0x71, - 0x48, 0x02, 0x00, 0x00, + proto.RegisterFile("ojo/gasestimate/v1/gasestimate.proto", fileDescriptor_6d6bf005bd9acf66) +} + +var fileDescriptor_6d6bf005bd9acf66 = []byte{ + // 312 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x91, 0xc1, 0x4e, 0xc2, 0x40, + 0x10, 0x86, 0xbb, 0x92, 0x20, 0x2c, 0x6a, 0x74, 0xe3, 0xa1, 0x51, 0xb3, 0x41, 0xa2, 0x09, 0x17, + 0xdb, 0xa0, 0x77, 0x13, 0x35, 0xc6, 0x68, 0x38, 0x98, 0x1e, 0xbd, 0x90, 0x05, 0x36, 0x6b, 0xab, + 0x65, 0xc8, 0xce, 0x80, 0xf2, 0x16, 0xde, 0x7c, 0x25, 0x8e, 0x1c, 0x3d, 0x2a, 0xbc, 0x88, 0xd9, + 0xda, 0x2a, 0xc4, 0xdb, 0xfc, 0x33, 0xdf, 0xff, 0xcf, 0xb4, 0xcb, 0x8f, 0x20, 0x81, 0xd0, 0x28, + 0xd4, 0x48, 0x71, 0xaa, 0x48, 0x87, 0xe3, 0xd6, 0xb2, 0x0c, 0x86, 0x16, 0x08, 0x84, 0x80, 0x04, + 0x82, 0xe5, 0xf6, 0xb8, 0xb5, 0xb7, 0x6b, 0xc0, 0x40, 0x36, 0x0e, 0x5d, 0xf5, 0x43, 0x36, 0xde, + 0x19, 0x2f, 0xdf, 0x2b, 0xab, 0x52, 0x14, 0xb7, 0x7c, 0xa7, 0x07, 0x03, 0xb2, 0xaa, 0x47, 0x1d, + 0xab, 0x4d, 0x8c, 0x64, 0x27, 0x3e, 0xab, 0x97, 0x9a, 0xb5, 0xd3, 0x83, 0xe0, 0x7f, 0x60, 0x70, + 0x95, 0xc3, 0xd1, 0x76, 0x61, 0x8b, 0x72, 0x97, 0xd8, 0xe7, 0x55, 0xa3, 0xb0, 0xf3, 0x1c, 0xa7, + 0x31, 0xf9, 0x6b, 0x75, 0xd6, 0xac, 0x46, 0x15, 0xa3, 0xb0, 0xed, 0xb4, 0x38, 0xe6, 0x5b, 0x6e, + 0xa8, 0xfa, 0xc9, 0x08, 0x29, 0xd5, 0x03, 0xf2, 0x4b, 0x19, 0xb1, 0x69, 0x14, 0x5e, 0xfc, 0x36, + 0x1b, 0xe7, 0xbc, 0x52, 0x6c, 0x10, 0x3e, 0x5f, 0x57, 0xfd, 0xbe, 0xd5, 0x88, 0x3e, 0xcb, 0xd8, + 0x42, 0xba, 0xc9, 0x40, 0xd3, 0x0b, 0xd8, 0xa7, 0x7c, 0x4f, 0x21, 0x1b, 0x77, 0xbc, 0x76, 0xa3, + 0xf0, 0x3a, 0x3f, 0x78, 0x19, 0x64, 0x2b, 0xa0, 0x38, 0xe4, 0x1b, 0xee, 0x9e, 0xe2, 0xd3, 0xb2, + 0x9c, 0x52, 0x54, 0x33, 0x7f, 0xe6, 0xcb, 0xf6, 0xf4, 0x4b, 0x7a, 0xd3, 0xb9, 0x64, 0xb3, 0xb9, + 0x64, 0x9f, 0x73, 0xc9, 0xde, 0x16, 0xd2, 0x9b, 0x2d, 0xa4, 0xf7, 0xb1, 0x90, 0xde, 0x43, 0x60, + 0x62, 0x7a, 0x1c, 0x75, 0x83, 0x1e, 0xa4, 0x21, 0x24, 0x70, 0x92, 0x07, 0xbb, 0x3a, 0x7c, 0x5d, + 0x79, 0x2c, 0x9a, 0x0c, 0x35, 0x76, 0xcb, 0xd9, 0xaf, 0x3f, 0xfb, 0x0e, 0x00, 0x00, 0xff, 0xff, + 0x53, 0x40, 0x5a, 0x05, 0xcc, 0x01, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -242,14 +201,14 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.GasAdjustment) > 0 { i -= len(m.GasAdjustment) copy(dAtA[i:], m.GasAdjustment) - i = encodeVarintGasEstimate(dAtA, i, uint64(len(m.GasAdjustment))) + i = encodeVarintGasestimate(dAtA, i, uint64(len(m.GasAdjustment))) i-- dAtA[i] = 0x1a } if len(m.GasLimit) > 0 { i -= len(m.GasLimit) copy(dAtA[i:], m.GasLimit) - i = encodeVarintGasEstimate(dAtA, i, uint64(len(m.GasLimit))) + i = encodeVarintGasestimate(dAtA, i, uint64(len(m.GasLimit))) i-- dAtA[i] = 0x12 } @@ -261,7 +220,7 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintGasEstimate(dAtA, i, uint64(size)) + i = encodeVarintGasestimate(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa @@ -293,57 +252,20 @@ func (m *Contract) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Network) > 0 { i -= len(m.Network) copy(dAtA[i:], m.Network) - i = encodeVarintGasEstimate(dAtA, i, uint64(len(m.Network))) + i = encodeVarintGasestimate(dAtA, i, uint64(len(m.Network))) i-- dAtA[i] = 0x12 } if len(m.Address) > 0 { i -= len(m.Address) copy(dAtA[i:], m.Address) - i = encodeVarintGasEstimate(dAtA, i, uint64(len(m.Address))) + i = encodeVarintGasestimate(dAtA, i, uint64(len(m.Address))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *GasEstimates) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GasEstimates) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GasEstimates) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.GasEstimates) > 0 { - for iNdEx := len(m.GasEstimates) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.GasEstimates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGasEstimate(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - func (m *GasEstimate) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -365,22 +287,22 @@ func (m *GasEstimate) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if m.GasEstimate != 0 { - i = encodeVarintGasEstimate(dAtA, i, uint64(m.GasEstimate)) + i = encodeVarintGasestimate(dAtA, i, uint64(m.GasEstimate)) i-- dAtA[i] = 0x10 } if len(m.Network) > 0 { i -= len(m.Network) copy(dAtA[i:], m.Network) - i = encodeVarintGasEstimate(dAtA, i, uint64(len(m.Network))) + i = encodeVarintGasestimate(dAtA, i, uint64(len(m.Network))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func encodeVarintGasEstimate(dAtA []byte, offset int, v uint64) int { - offset -= sovGasEstimate(v) +func encodeVarintGasestimate(dAtA []byte, offset int, v uint64) int { + offset -= sovGasestimate(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) @@ -399,16 +321,16 @@ func (m *Params) Size() (n int) { if len(m.ContractRegistry) > 0 { for _, e := range m.ContractRegistry { l = e.Size() - n += 1 + l + sovGasEstimate(uint64(l)) + n += 1 + l + sovGasestimate(uint64(l)) } } l = len(m.GasLimit) if l > 0 { - n += 1 + l + sovGasEstimate(uint64(l)) + n += 1 + l + sovGasestimate(uint64(l)) } l = len(m.GasAdjustment) if l > 0 { - n += 1 + l + sovGasEstimate(uint64(l)) + n += 1 + l + sovGasestimate(uint64(l)) } return n } @@ -421,26 +343,11 @@ func (m *Contract) Size() (n int) { _ = l l = len(m.Address) if l > 0 { - n += 1 + l + sovGasEstimate(uint64(l)) + n += 1 + l + sovGasestimate(uint64(l)) } l = len(m.Network) if l > 0 { - n += 1 + l + sovGasEstimate(uint64(l)) - } - return n -} - -func (m *GasEstimates) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.GasEstimates) > 0 { - for _, e := range m.GasEstimates { - l = e.Size() - n += 1 + l + sovGasEstimate(uint64(l)) - } + n += 1 + l + sovGasestimate(uint64(l)) } return n } @@ -453,19 +360,19 @@ func (m *GasEstimate) Size() (n int) { _ = l l = len(m.Network) if l > 0 { - n += 1 + l + sovGasEstimate(uint64(l)) + n += 1 + l + sovGasestimate(uint64(l)) } if m.GasEstimate != 0 { - n += 1 + sovGasEstimate(uint64(m.GasEstimate)) + n += 1 + sovGasestimate(uint64(m.GasEstimate)) } return n } -func sovGasEstimate(x uint64) (n int) { +func sovGasestimate(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } -func sozGasEstimate(x uint64) (n int) { - return sovGasEstimate(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +func sozGasestimate(x uint64) (n int) { + return sovGasestimate(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (m *Params) Unmarshal(dAtA []byte) error { l := len(dAtA) @@ -475,7 +382,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowGasEstimate + return ErrIntOverflowGasestimate } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -503,7 +410,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowGasEstimate + return ErrIntOverflowGasestimate } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -516,11 +423,11 @@ func (m *Params) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthGasEstimate + return ErrInvalidLengthGasestimate } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthGasEstimate + return ErrInvalidLengthGasestimate } if postIndex > l { return io.ErrUnexpectedEOF @@ -537,7 +444,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowGasEstimate + return ErrIntOverflowGasestimate } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -551,11 +458,11 @@ func (m *Params) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthGasEstimate + return ErrInvalidLengthGasestimate } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthGasEstimate + return ErrInvalidLengthGasestimate } if postIndex > l { return io.ErrUnexpectedEOF @@ -569,7 +476,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowGasEstimate + return ErrIntOverflowGasestimate } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -583,11 +490,11 @@ func (m *Params) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthGasEstimate + return ErrInvalidLengthGasestimate } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthGasEstimate + return ErrInvalidLengthGasestimate } if postIndex > l { return io.ErrUnexpectedEOF @@ -596,12 +503,12 @@ func (m *Params) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipGasEstimate(dAtA[iNdEx:]) + skippy, err := skipGasestimate(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGasEstimate + return ErrInvalidLengthGasestimate } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -623,7 +530,7 @@ func (m *Contract) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowGasEstimate + return ErrIntOverflowGasestimate } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -651,7 +558,7 @@ func (m *Contract) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowGasEstimate + return ErrIntOverflowGasestimate } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -665,11 +572,11 @@ func (m *Contract) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthGasEstimate + return ErrInvalidLengthGasestimate } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthGasEstimate + return ErrInvalidLengthGasestimate } if postIndex > l { return io.ErrUnexpectedEOF @@ -683,7 +590,7 @@ func (m *Contract) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowGasEstimate + return ErrIntOverflowGasestimate } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -697,11 +604,11 @@ func (m *Contract) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthGasEstimate + return ErrInvalidLengthGasestimate } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthGasEstimate + return ErrInvalidLengthGasestimate } if postIndex > l { return io.ErrUnexpectedEOF @@ -710,96 +617,12 @@ func (m *Contract) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipGasEstimate(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGasEstimate - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GasEstimates) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGasEstimate - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GasEstimates: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GasEstimates: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GasEstimates", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGasEstimate - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGasEstimate - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGasEstimate - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.GasEstimates = append(m.GasEstimates, &GasEstimate{}) - if err := m.GasEstimates[len(m.GasEstimates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGasEstimate(dAtA[iNdEx:]) + skippy, err := skipGasestimate(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGasEstimate + return ErrInvalidLengthGasestimate } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -821,7 +644,7 @@ func (m *GasEstimate) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowGasEstimate + return ErrIntOverflowGasestimate } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -849,7 +672,7 @@ func (m *GasEstimate) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowGasEstimate + return ErrIntOverflowGasestimate } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -863,11 +686,11 @@ func (m *GasEstimate) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthGasEstimate + return ErrInvalidLengthGasestimate } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthGasEstimate + return ErrInvalidLengthGasestimate } if postIndex > l { return io.ErrUnexpectedEOF @@ -881,7 +704,7 @@ func (m *GasEstimate) Unmarshal(dAtA []byte) error { m.GasEstimate = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowGasEstimate + return ErrIntOverflowGasestimate } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -895,12 +718,12 @@ func (m *GasEstimate) Unmarshal(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skipGasEstimate(dAtA[iNdEx:]) + skippy, err := skipGasestimate(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGasEstimate + return ErrInvalidLengthGasestimate } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -914,7 +737,7 @@ func (m *GasEstimate) Unmarshal(dAtA []byte) error { } return nil } -func skipGasEstimate(dAtA []byte) (n int, err error) { +func skipGasestimate(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 depth := 0 @@ -922,7 +745,7 @@ func skipGasEstimate(dAtA []byte) (n int, err error) { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowGasEstimate + return 0, ErrIntOverflowGasestimate } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -939,7 +762,7 @@ func skipGasEstimate(dAtA []byte) (n int, err error) { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowGasEstimate + return 0, ErrIntOverflowGasestimate } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -955,7 +778,7 @@ func skipGasEstimate(dAtA []byte) (n int, err error) { var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowGasEstimate + return 0, ErrIntOverflowGasestimate } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -968,14 +791,14 @@ func skipGasEstimate(dAtA []byte) (n int, err error) { } } if length < 0 { - return 0, ErrInvalidLengthGasEstimate + return 0, ErrInvalidLengthGasestimate } iNdEx += length case 3: depth++ case 4: if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGasEstimate + return 0, ErrUnexpectedEndOfGroupGasestimate } depth-- case 5: @@ -984,7 +807,7 @@ func skipGasEstimate(dAtA []byte) (n int, err error) { return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { - return 0, ErrInvalidLengthGasEstimate + return 0, ErrInvalidLengthGasestimate } if depth == 0 { return iNdEx, nil @@ -994,7 +817,7 @@ func skipGasEstimate(dAtA []byte) (n int, err error) { } var ( - ErrInvalidLengthGasEstimate = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGasEstimate = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGasEstimate = fmt.Errorf("proto: unexpected end of group") + ErrInvalidLengthGasestimate = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGasestimate = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGasestimate = fmt.Errorf("proto: unexpected end of group") ) diff --git a/x/gas_estimate/types/genesis.go b/x/gasestimate/types/genesis.go similarity index 100% rename from x/gas_estimate/types/genesis.go rename to x/gasestimate/types/genesis.go diff --git a/x/gas_estimate/types/genesis.pb.go b/x/gasestimate/types/genesis.pb.go similarity index 80% rename from x/gas_estimate/types/genesis.pb.go rename to x/gasestimate/types/genesis.pb.go index ce5f6a95..d4b03192 100644 --- a/x/gas_estimate/types/genesis.pb.go +++ b/x/gasestimate/types/genesis.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: ojo/gas_estimate/v1/genesis.proto +// source: ojo/gasestimate/v1/genesis.proto package types @@ -23,7 +23,7 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// GenesisState represents the genesis state of the gas_estimate module. +// GenesisState represents the genesis state of the gasestimate module. type GenesisState struct { Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` } @@ -32,7 +32,7 @@ func (m *GenesisState) Reset() { *m = GenesisState{} } func (m *GenesisState) String() string { return proto.CompactTextString(m) } func (*GenesisState) ProtoMessage() {} func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_73533fb6031286e0, []int{0} + return fileDescriptor_6a5024fb35e6df0b, []int{0} } func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -69,26 +69,26 @@ func (m *GenesisState) GetParams() Params { } func init() { - proto.RegisterType((*GenesisState)(nil), "ojo.gas_estimate.v1.GenesisState") + proto.RegisterType((*GenesisState)(nil), "ojo.gasestimate.v1.GenesisState") } -func init() { proto.RegisterFile("ojo/gas_estimate/v1/genesis.proto", fileDescriptor_73533fb6031286e0) } +func init() { proto.RegisterFile("ojo/gasestimate/v1/genesis.proto", fileDescriptor_6a5024fb35e6df0b) } -var fileDescriptor_73533fb6031286e0 = []byte{ - // 206 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xcc, 0xcf, 0xca, 0xd7, - 0x4f, 0x4f, 0x2c, 0x8e, 0x4f, 0x2d, 0x2e, 0xc9, 0xcc, 0x4d, 0x2c, 0x49, 0xd5, 0x2f, 0x33, 0xd4, - 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0xce, - 0xcf, 0xca, 0xd7, 0x43, 0x56, 0xa2, 0x57, 0x66, 0x28, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x96, - 0xd7, 0x07, 0xb1, 0x20, 0x4a, 0xa5, 0xd4, 0xb0, 0x9a, 0x86, 0xac, 0x15, 0xac, 0x4e, 0xc9, 0x93, - 0x8b, 0xc7, 0x1d, 0x62, 0x47, 0x70, 0x49, 0x62, 0x49, 0xaa, 0x90, 0x25, 0x17, 0x5b, 0x41, 0x62, - 0x51, 0x62, 0x6e, 0xb1, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0xb4, 0x1e, 0x16, 0x3b, 0xf5, - 0x02, 0xc0, 0x4a, 0x9c, 0x58, 0x4e, 0xdc, 0x93, 0x67, 0x08, 0x82, 0x6a, 0x70, 0xf2, 0x3c, 0xf1, - 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, - 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xfd, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, - 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0xfc, 0xac, 0x7c, 0xdd, 0xbc, 0xd4, 0x92, 0xf2, 0xfc, 0xa2, 0x6c, - 0x10, 0x5b, 0xbf, 0x02, 0xd5, 0x95, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0xc7, 0x19, - 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x01, 0x38, 0x50, 0xe8, 0x14, 0x01, 0x00, 0x00, +var fileDescriptor_6a5024fb35e6df0b = []byte{ + // 205 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xc8, 0xcf, 0xca, 0xd7, + 0x4f, 0x4f, 0x2c, 0x4e, 0x2d, 0x2e, 0xc9, 0xcc, 0x4d, 0x2c, 0x49, 0xd5, 0x2f, 0x33, 0xd4, 0x4f, + 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0xca, 0xcf, + 0xca, 0xd7, 0x43, 0x52, 0xa1, 0x57, 0x66, 0x28, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x96, 0xd6, + 0x07, 0xb1, 0x20, 0x2a, 0xa5, 0x54, 0xb0, 0x99, 0x85, 0xa4, 0x11, 0xac, 0x4a, 0xc9, 0x83, 0x8b, + 0xc7, 0x1d, 0x62, 0x41, 0x70, 0x49, 0x62, 0x49, 0xaa, 0x90, 0x05, 0x17, 0x5b, 0x41, 0x62, 0x51, + 0x62, 0x6e, 0xb1, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0x94, 0x1e, 0xa6, 0x85, 0x7a, 0x01, + 0x60, 0x15, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x41, 0xd5, 0x3b, 0x79, 0x9c, 0x78, 0x24, + 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, + 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x5e, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, + 0x72, 0x7e, 0xae, 0x7e, 0x7e, 0x56, 0xbe, 0x6e, 0x5e, 0x6a, 0x49, 0x79, 0x7e, 0x51, 0x36, 0x88, + 0xad, 0x5f, 0x81, 0xe2, 0xc4, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0xd3, 0x8c, 0x01, + 0x01, 0x00, 0x00, 0xff, 0xff, 0xd4, 0x50, 0x06, 0x27, 0x0e, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/gas_estimate/types/keys.go b/x/gasestimate/types/keys.go similarity index 74% rename from x/gas_estimate/types/keys.go rename to x/gasestimate/types/keys.go index 507075ed..8be44e1d 100644 --- a/x/gas_estimate/types/keys.go +++ b/x/gasestimate/types/keys.go @@ -1,8 +1,8 @@ package types const ( - // ModuleName is the name of the gas_estimate module - ModuleName = "gas_estimate" + // ModuleName is the name of the gasestimate module + ModuleName = "gasestimate" // StoreKey is the string store representation StoreKey = ModuleName @@ -10,7 +10,7 @@ const ( // RouterKey is the message route RouterKey = ModuleName - // QuerierRoute is the query router key for the gas_estimate module + // QuerierRoute is the query router key for the gasestimate module QuerierRoute = ModuleName ) diff --git a/x/gas_estimate/types/msgs.go b/x/gasestimate/types/msgs.go similarity index 100% rename from x/gas_estimate/types/msgs.go rename to x/gasestimate/types/msgs.go diff --git a/x/gas_estimate/types/params.go b/x/gasestimate/types/params.go similarity index 100% rename from x/gas_estimate/types/params.go rename to x/gasestimate/types/params.go diff --git a/x/gas_estimate/types/query.pb.go b/x/gasestimate/types/query.pb.go similarity index 85% rename from x/gas_estimate/types/query.pb.go rename to x/gasestimate/types/query.pb.go index 84128f0d..8fc53777 100644 --- a/x/gas_estimate/types/query.pb.go +++ b/x/gasestimate/types/query.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: ojo/gas_estimate/v1/query.proto +// source: ojo/gasestimate/v1/query.proto package types @@ -37,7 +37,7 @@ func (m *ParamsRequest) Reset() { *m = ParamsRequest{} } func (m *ParamsRequest) String() string { return proto.CompactTextString(m) } func (*ParamsRequest) ProtoMessage() {} func (*ParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_4e379229c45496cb, []int{0} + return fileDescriptor_7263547b77ac5672, []int{0} } func (m *ParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -76,7 +76,7 @@ func (m *ParamsResponse) Reset() { *m = ParamsResponse{} } func (m *ParamsResponse) String() string { return proto.CompactTextString(m) } func (*ParamsResponse) ProtoMessage() {} func (*ParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4e379229c45496cb, []int{1} + return fileDescriptor_7263547b77ac5672, []int{1} } func (m *ParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -112,6 +112,7 @@ func (m *ParamsResponse) GetParams() Params { return Params{} } +// GasEstimateRequest is the request type for the Query/GasEstimate RPC method. type GasEstimateRequest struct { Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"` } @@ -120,7 +121,7 @@ func (m *GasEstimateRequest) Reset() { *m = GasEstimateRequest{} } func (m *GasEstimateRequest) String() string { return proto.CompactTextString(m) } func (*GasEstimateRequest) ProtoMessage() {} func (*GasEstimateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_4e379229c45496cb, []int{2} + return fileDescriptor_7263547b77ac5672, []int{2} } func (m *GasEstimateRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -156,6 +157,7 @@ func (m *GasEstimateRequest) GetNetwork() string { return "" } +// GasEstimateResponse is the response type for the Query/GasEstimate RPC method. type GasEstimateResponse struct { GasEstimate int64 `protobuf:"varint,1,opt,name=gas_estimate,json=gasEstimate,proto3" json:"gas_estimate,omitempty"` } @@ -164,7 +166,7 @@ func (m *GasEstimateResponse) Reset() { *m = GasEstimateResponse{} } func (m *GasEstimateResponse) String() string { return proto.CompactTextString(m) } func (*GasEstimateResponse) ProtoMessage() {} func (*GasEstimateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4e379229c45496cb, []int{3} + return fileDescriptor_7263547b77ac5672, []int{3} } func (m *GasEstimateResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -201,39 +203,39 @@ func (m *GasEstimateResponse) GetGasEstimate() int64 { } func init() { - proto.RegisterType((*ParamsRequest)(nil), "ojo.gas_estimate.v1.ParamsRequest") - proto.RegisterType((*ParamsResponse)(nil), "ojo.gas_estimate.v1.ParamsResponse") - proto.RegisterType((*GasEstimateRequest)(nil), "ojo.gas_estimate.v1.GasEstimateRequest") - proto.RegisterType((*GasEstimateResponse)(nil), "ojo.gas_estimate.v1.GasEstimateResponse") -} - -func init() { proto.RegisterFile("ojo/gas_estimate/v1/query.proto", fileDescriptor_4e379229c45496cb) } - -var fileDescriptor_4e379229c45496cb = []byte{ - // 360 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcf, 0xcf, 0xca, 0xd7, - 0x4f, 0x4f, 0x2c, 0x8e, 0x4f, 0x2d, 0x2e, 0xc9, 0xcc, 0x4d, 0x2c, 0x49, 0xd5, 0x2f, 0x33, 0xd4, - 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0xce, 0xcf, 0xca, - 0xd7, 0x43, 0x56, 0xa0, 0x57, 0x66, 0x28, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x96, 0xd7, 0x07, - 0xb1, 0x20, 0x4a, 0xa5, 0x64, 0xd2, 0xf3, 0xf3, 0xd3, 0x73, 0x52, 0xf5, 0x13, 0x0b, 0x32, 0xf5, - 0x13, 0xf3, 0xf2, 0xf2, 0x4b, 0x12, 0x4b, 0x32, 0xf3, 0xf3, 0x8a, 0xa1, 0xb2, 0x6a, 0xd8, 0x6c, - 0x42, 0x31, 0x18, 0xac, 0x4e, 0x89, 0x9f, 0x8b, 0x37, 0x20, 0xb1, 0x28, 0x31, 0xb7, 0x38, 0x28, - 0xb5, 0xb0, 0x34, 0xb5, 0xb8, 0x44, 0xc9, 0x9b, 0x8b, 0x0f, 0x26, 0x50, 0x5c, 0x90, 0x9f, 0x57, - 0x9c, 0x2a, 0x64, 0xc9, 0xc5, 0x56, 0x00, 0x16, 0x91, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x36, 0x92, - 0xd6, 0xc3, 0xe2, 0x48, 0x3d, 0x88, 0x26, 0x27, 0x96, 0x13, 0xf7, 0xe4, 0x19, 0x82, 0xa0, 0x1a, - 0x94, 0xf4, 0xb8, 0x84, 0xdc, 0x13, 0x8b, 0x5d, 0xa1, 0xca, 0xa0, 0x56, 0x08, 0x49, 0x70, 0xb1, - 0xe7, 0xa5, 0x96, 0x94, 0xe7, 0x17, 0x65, 0x83, 0x4d, 0xe4, 0x0c, 0x82, 0x71, 0x95, 0x2c, 0xb8, - 0x84, 0x51, 0xd4, 0x43, 0x5d, 0xa0, 0xc8, 0xc5, 0x83, 0x6c, 0x1d, 0x58, 0x17, 0x73, 0x10, 0x77, - 0x3a, 0x42, 0xa9, 0x51, 0x2f, 0x13, 0x17, 0x6b, 0x20, 0x28, 0x20, 0x85, 0xca, 0xb8, 0xd8, 0x20, - 0x6e, 0x11, 0x52, 0xc2, 0xe3, 0x50, 0xa8, 0x5b, 0xa4, 0x94, 0xf1, 0xaa, 0x81, 0xd8, 0xaf, 0xa4, - 0xdc, 0x74, 0xf9, 0xc9, 0x64, 0x26, 0x59, 0x21, 0x69, 0x7d, 0x6c, 0xa1, 0x0a, 0xf1, 0xab, 0x50, - 0x37, 0x23, 0x17, 0x37, 0x92, 0xe3, 0x85, 0xd4, 0xb1, 0x9a, 0x8c, 0x19, 0x1c, 0x52, 0x1a, 0x84, - 0x15, 0x42, 0xdd, 0xa1, 0x09, 0x76, 0x87, 0xb2, 0x90, 0xa2, 0x3e, 0xa1, 0xd8, 0x75, 0xf2, 0x3c, - 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, - 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xfd, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, - 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x90, 0x31, 0xba, 0xd0, 0xb0, 0x07, 0x1b, 0x59, 0x81, 0x6a, 0x68, - 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0x38, 0xa5, 0x18, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, - 0x48, 0xb7, 0xa2, 0x3d, 0xbd, 0x02, 0x00, 0x00, + proto.RegisterType((*ParamsRequest)(nil), "ojo.gasestimate.v1.ParamsRequest") + proto.RegisterType((*ParamsResponse)(nil), "ojo.gasestimate.v1.ParamsResponse") + proto.RegisterType((*GasEstimateRequest)(nil), "ojo.gasestimate.v1.GasEstimateRequest") + proto.RegisterType((*GasEstimateResponse)(nil), "ojo.gasestimate.v1.GasEstimateResponse") +} + +func init() { proto.RegisterFile("ojo/gasestimate/v1/query.proto", fileDescriptor_7263547b77ac5672) } + +var fileDescriptor_7263547b77ac5672 = []byte{ + // 358 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0x3f, 0x4f, 0xfa, 0x40, + 0x18, 0xc7, 0x5b, 0x7e, 0x3f, 0x31, 0x1e, 0xfe, 0x49, 0x4e, 0x07, 0xd2, 0x90, 0x22, 0x17, 0x23, + 0x2e, 0xde, 0x05, 0x5c, 0x98, 0x49, 0x8c, 0xc6, 0x49, 0x3b, 0xba, 0x98, 0xc3, 0x5c, 0xce, 0xa2, + 0xf4, 0x29, 0xbd, 0x03, 0x65, 0x75, 0xd0, 0xd5, 0xc4, 0x37, 0xc5, 0x48, 0xe2, 0xe2, 0x64, 0x0c, + 0xf8, 0x42, 0x0c, 0xd7, 0x23, 0x42, 0x40, 0xdc, 0xda, 0x7b, 0x3e, 0xcf, 0xf7, 0xf9, 0xf4, 0xe9, + 0x21, 0x1f, 0x9a, 0xc0, 0x24, 0x57, 0x42, 0xe9, 0xb0, 0xc5, 0xb5, 0x60, 0xdd, 0x0a, 0x6b, 0x77, + 0x44, 0xd2, 0xa3, 0x71, 0x02, 0x1a, 0x30, 0x86, 0x26, 0xd0, 0xa9, 0x3a, 0xed, 0x56, 0xbc, 0x1d, + 0x09, 0x12, 0x4c, 0x99, 0x8d, 0x9f, 0x52, 0xd2, 0x2b, 0x48, 0x00, 0x79, 0x27, 0x18, 0x8f, 0x43, + 0xc6, 0xa3, 0x08, 0x34, 0xd7, 0x21, 0x44, 0xca, 0x56, 0xf7, 0x16, 0xcc, 0x99, 0x8e, 0x35, 0x14, + 0xd9, 0x42, 0x1b, 0xe7, 0x3c, 0xe1, 0x2d, 0x15, 0x88, 0x76, 0x47, 0x28, 0x4d, 0xce, 0xd0, 0xe6, + 0xe4, 0x40, 0xc5, 0x10, 0x29, 0x81, 0x6b, 0x28, 0x1b, 0x9b, 0x93, 0xbc, 0xbb, 0xeb, 0x1e, 0xe4, + 0xaa, 0x1e, 0x9d, 0x37, 0xa4, 0x69, 0x4f, 0xfd, 0x7f, 0xff, 0xa3, 0xe8, 0x04, 0x96, 0x27, 0x14, + 0xe1, 0x13, 0xae, 0x8e, 0x2d, 0x66, 0x27, 0xe0, 0x3c, 0x5a, 0x8d, 0x84, 0xbe, 0x87, 0xe4, 0xd6, + 0x04, 0xae, 0x05, 0x93, 0x57, 0x52, 0x43, 0xdb, 0x33, 0xbc, 0x15, 0x28, 0xa1, 0x75, 0xc9, 0xd5, + 0xd5, 0x64, 0x9c, 0xe9, 0xfa, 0x17, 0xe4, 0xe4, 0x0f, 0x5a, 0x7d, 0xca, 0xa0, 0x95, 0x8b, 0xf1, + 0x12, 0xb1, 0x42, 0xd9, 0xd4, 0x05, 0x97, 0x7e, 0xf7, 0xb4, 0x2a, 0x1e, 0x59, 0x86, 0xa4, 0xd3, + 0x09, 0x79, 0x7c, 0xfb, 0x7a, 0xcd, 0x14, 0xb0, 0xc7, 0x16, 0x2c, 0x34, 0xfd, 0x50, 0xfc, 0xec, + 0xa2, 0xdc, 0x94, 0x39, 0xde, 0x5f, 0x94, 0x3b, 0xbf, 0x0a, 0xaf, 0xfc, 0x27, 0x67, 0x25, 0xca, + 0x46, 0xa2, 0x84, 0x8b, 0x6c, 0xf9, 0x5f, 0xad, 0x9f, 0xf6, 0x87, 0xbe, 0x3b, 0x18, 0xfa, 0xee, + 0xe7, 0xd0, 0x77, 0x5f, 0x46, 0xbe, 0x33, 0x18, 0xf9, 0xce, 0xfb, 0xc8, 0x77, 0x2e, 0xa9, 0x0c, + 0xf5, 0x4d, 0xa7, 0x41, 0xaf, 0xa1, 0x35, 0x0e, 0x39, 0xb4, 0x4b, 0x37, 0x81, 0x0f, 0x33, 0x91, + 0xba, 0x17, 0x0b, 0xd5, 0xc8, 0x9a, 0x0b, 0x72, 0xf4, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x1e, 0xc7, + 0x84, 0xd6, 0xb0, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -250,6 +252,7 @@ const _ = grpc.SupportPackageIsVersion4 type QueryClient interface { // Params queries all parameters. Params(ctx context.Context, in *ParamsRequest, opts ...grpc.CallOption) (*ParamsResponse, error) + // GasEstimate queries the gas estimate for a given network. GasEstimate(ctx context.Context, in *GasEstimateRequest, opts ...grpc.CallOption) (*GasEstimateResponse, error) } @@ -263,7 +266,7 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { func (c *queryClient) Params(ctx context.Context, in *ParamsRequest, opts ...grpc.CallOption) (*ParamsResponse, error) { out := new(ParamsResponse) - err := c.cc.Invoke(ctx, "/ojo.gas_estimate.v1.Query/Params", in, out, opts...) + err := c.cc.Invoke(ctx, "/ojo.gasestimate.v1.Query/Params", in, out, opts...) if err != nil { return nil, err } @@ -272,7 +275,7 @@ func (c *queryClient) Params(ctx context.Context, in *ParamsRequest, opts ...grp func (c *queryClient) GasEstimate(ctx context.Context, in *GasEstimateRequest, opts ...grpc.CallOption) (*GasEstimateResponse, error) { out := new(GasEstimateResponse) - err := c.cc.Invoke(ctx, "/ojo.gas_estimate.v1.Query/GasEstimate", in, out, opts...) + err := c.cc.Invoke(ctx, "/ojo.gasestimate.v1.Query/GasEstimate", in, out, opts...) if err != nil { return nil, err } @@ -283,6 +286,7 @@ func (c *queryClient) GasEstimate(ctx context.Context, in *GasEstimateRequest, o type QueryServer interface { // Params queries all parameters. Params(context.Context, *ParamsRequest) (*ParamsResponse, error) + // GasEstimate queries the gas estimate for a given network. GasEstimate(context.Context, *GasEstimateRequest) (*GasEstimateResponse, error) } @@ -311,7 +315,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ojo.gas_estimate.v1.Query/Params", + FullMethod: "/ojo.gasestimate.v1.Query/Params", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Params(ctx, req.(*ParamsRequest)) @@ -329,7 +333,7 @@ func _Query_GasEstimate_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ojo.gas_estimate.v1.Query/GasEstimate", + FullMethod: "/ojo.gasestimate.v1.Query/GasEstimate", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).GasEstimate(ctx, req.(*GasEstimateRequest)) @@ -338,7 +342,7 @@ func _Query_GasEstimate_Handler(srv interface{}, ctx context.Context, dec func(i } var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "ojo.gas_estimate.v1.Query", + ServiceName: "ojo.gasestimate.v1.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { @@ -351,7 +355,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "ojo/gas_estimate/v1/query.proto", + Metadata: "ojo/gasestimate/v1/query.proto", } func (m *ParamsRequest) Marshal() (dAtA []byte, err error) { diff --git a/x/gas_estimate/types/query.pb.gw.go b/x/gasestimate/types/query.pb.gw.go similarity index 96% rename from x/gas_estimate/types/query.pb.gw.go rename to x/gasestimate/types/query.pb.gw.go index 948e3a8c..be1bb7e0 100644 --- a/x/gas_estimate/types/query.pb.gw.go +++ b/x/gasestimate/types/query.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: ojo/gas_estimate/v1/query.proto +// source: ojo/gasestimate/v1/query.proto /* Package types is a reverse proxy. @@ -224,9 +224,9 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ojo", "gas_estimate", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ojo", "gasestimate", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_GasEstimate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1}, []string{"ojo", "gas_estimate", "v1"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_GasEstimate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1}, []string{"ojo", "gasestimate", "v1"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( diff --git a/x/gas_estimate/types/tx.pb.go b/x/gasestimate/types/tx.pb.go similarity index 81% rename from x/gas_estimate/types/tx.pb.go rename to x/gasestimate/types/tx.pb.go index f7c8d5fd..a0abf338 100644 --- a/x/gas_estimate/types/tx.pb.go +++ b/x/gasestimate/types/tx.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: ojo/gas_estimate/v1/tx.proto +// source: ojo/gasestimate/v1/tx.proto package types @@ -35,7 +35,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type MsgSetParams struct { // authority is the address that controls the module (defaults to x/gov unless overwritten). Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // params defines the gas_estimate parameters to update. + // params defines the gasestimate parameters to update. Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` } @@ -43,7 +43,7 @@ func (m *MsgSetParams) Reset() { *m = MsgSetParams{} } func (m *MsgSetParams) String() string { return proto.CompactTextString(m) } func (*MsgSetParams) ProtoMessage() {} func (*MsgSetParams) Descriptor() ([]byte, []int) { - return fileDescriptor_22130116a604dfb5, []int{0} + return fileDescriptor_2bbc287192e290e2, []int{0} } func (m *MsgSetParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -80,7 +80,7 @@ func (m *MsgSetParamsResponse) Reset() { *m = MsgSetParamsResponse{} } func (m *MsgSetParamsResponse) String() string { return proto.CompactTextString(m) } func (*MsgSetParamsResponse) ProtoMessage() {} func (*MsgSetParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_22130116a604dfb5, []int{1} + return fileDescriptor_2bbc287192e290e2, []int{1} } func (m *MsgSetParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -110,36 +110,36 @@ func (m *MsgSetParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSetParamsResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*MsgSetParams)(nil), "ojo.gas_estimate.v1.MsgSetParams") - proto.RegisterType((*MsgSetParamsResponse)(nil), "ojo.gas_estimate.v1.MsgSetParamsResponse") -} - -func init() { proto.RegisterFile("ojo/gas_estimate/v1/tx.proto", fileDescriptor_22130116a604dfb5) } - -var fileDescriptor_22130116a604dfb5 = []byte{ - // 343 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xc9, 0xcf, 0xca, 0xd7, - 0x4f, 0x4f, 0x2c, 0x8e, 0x4f, 0x2d, 0x2e, 0xc9, 0xcc, 0x4d, 0x2c, 0x49, 0xd5, 0x2f, 0x33, 0xd4, - 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0xce, 0xcf, 0xca, 0xd7, 0x43, 0x96, - 0xd5, 0x2b, 0x33, 0x94, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0xcb, 0xeb, 0x83, 0x58, 0x10, 0xa5, - 0x52, 0x6a, 0xd8, 0x0c, 0x42, 0xd1, 0x0a, 0x51, 0x27, 0x99, 0x9c, 0x5f, 0x9c, 0x9b, 0x5f, 0x1c, - 0x0f, 0x31, 0x00, 0xc2, 0x81, 0x4a, 0x89, 0x43, 0x78, 0xfa, 0xb9, 0xc5, 0xe9, 0x20, 0xcd, 0xb9, - 0xc5, 0xe9, 0x50, 0x09, 0x39, 0xa8, 0x44, 0x52, 0x62, 0x31, 0xc8, 0xd8, 0xa4, 0xd4, 0x92, 0x44, - 0x43, 0xfd, 0xe4, 0xfc, 0xcc, 0x3c, 0x88, 0xbc, 0xd2, 0x64, 0x46, 0x2e, 0x1e, 0xdf, 0xe2, 0xf4, - 0xe0, 0xd4, 0x92, 0x80, 0xc4, 0xa2, 0xc4, 0xdc, 0x62, 0x21, 0x33, 0x2e, 0xce, 0xc4, 0xd2, 0x92, - 0x8c, 0xfc, 0xa2, 0xcc, 0x92, 0x4a, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x4e, 0x27, 0x89, 0x4b, 0x5b, - 0x74, 0x45, 0xa0, 0xd6, 0x39, 0xa6, 0xa4, 0x14, 0xa5, 0x16, 0x17, 0x07, 0x97, 0x14, 0x65, 0xe6, - 0xa5, 0x07, 0x21, 0x94, 0x0a, 0x19, 0x73, 0xb1, 0x15, 0x80, 0x4d, 0x90, 0x60, 0x52, 0x60, 0xd4, - 0xe0, 0x36, 0x92, 0xd6, 0xc3, 0x12, 0x00, 0x7a, 0x10, 0x4b, 0x82, 0xa0, 0x4a, 0xad, 0xc4, 0x3a, - 0x16, 0xc8, 0x33, 0xbc, 0x58, 0x20, 0xcf, 0xd0, 0xf4, 0x7c, 0x83, 0x16, 0xc2, 0x30, 0x25, 0x31, - 0x2e, 0x11, 0x64, 0x47, 0x05, 0xa5, 0x16, 0x17, 0xe4, 0xe7, 0x15, 0xa7, 0x1a, 0x25, 0x70, 0x31, - 0xfb, 0x16, 0xa7, 0x0b, 0x45, 0x72, 0x71, 0x22, 0x1c, 0xac, 0x88, 0xd5, 0x22, 0x64, 0xed, 0x52, - 0x9a, 0x04, 0x95, 0xc0, 0x6c, 0x70, 0xf2, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, - 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, - 0x86, 0x28, 0xfd, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0xfc, 0xac, - 0x7c, 0xdd, 0xbc, 0xd4, 0x92, 0xf2, 0xfc, 0xa2, 0x6c, 0x10, 0x5b, 0xbf, 0x02, 0x35, 0xfa, 0x4a, - 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x21, 0x6c, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xcb, - 0x0d, 0xa8, 0x72, 0x28, 0x02, 0x00, 0x00, + proto.RegisterType((*MsgSetParams)(nil), "ojo.gasestimate.v1.MsgSetParams") + proto.RegisterType((*MsgSetParamsResponse)(nil), "ojo.gasestimate.v1.MsgSetParamsResponse") +} + +func init() { proto.RegisterFile("ojo/gasestimate/v1/tx.proto", fileDescriptor_2bbc287192e290e2) } + +var fileDescriptor_2bbc287192e290e2 = []byte{ + // 342 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x91, 0xbf, 0x4b, 0xc3, 0x40, + 0x14, 0xc7, 0x13, 0x85, 0x42, 0x4f, 0xa7, 0x50, 0x6a, 0x8d, 0x70, 0x2d, 0xc5, 0xa1, 0x08, 0xbd, + 0xa3, 0x15, 0x1c, 0xdc, 0xec, 0xe4, 0x52, 0x90, 0x76, 0x10, 0x1c, 0x94, 0x4b, 0x7b, 0x5c, 0x53, + 0x49, 0x5e, 0xc8, 0xbb, 0xd6, 0x76, 0x75, 0x72, 0x14, 0xff, 0x82, 0xfe, 0x09, 0x0e, 0xfe, 0x11, + 0x8e, 0xc5, 0xc9, 0x51, 0xda, 0x41, 0xff, 0x0c, 0x49, 0x2f, 0xd2, 0x88, 0x05, 0xb7, 0xf7, 0xf8, + 0x7c, 0x7f, 0xbc, 0xe4, 0xc8, 0x01, 0x0c, 0x81, 0x2b, 0x81, 0x12, 0xb5, 0x1f, 0x08, 0x2d, 0xf9, + 0xb8, 0xc1, 0xf5, 0x84, 0x45, 0x31, 0x68, 0x70, 0x1c, 0x18, 0x02, 0xcb, 0x40, 0x36, 0x6e, 0xb8, + 0x05, 0x05, 0x0a, 0x56, 0x98, 0x27, 0x93, 0x51, 0xba, 0x87, 0x1b, 0x62, 0xb2, 0x46, 0xa3, 0xda, + 0xef, 0x01, 0x06, 0x80, 0x37, 0xc6, 0x6e, 0x96, 0x14, 0xed, 0x99, 0x8d, 0x07, 0xa8, 0x12, 0x6f, + 0x80, 0x2a, 0x05, 0x34, 0x05, 0x9e, 0xc0, 0x24, 0xd5, 0x93, 0x5a, 0x34, 0x78, 0x0f, 0xfc, 0xd0, + 0xf0, 0xea, 0x93, 0x4d, 0x76, 0xdb, 0xa8, 0xba, 0x52, 0x5f, 0x88, 0x58, 0x04, 0xe8, 0x9c, 0x90, + 0xbc, 0x18, 0xe9, 0x01, 0xc4, 0xbe, 0x9e, 0x96, 0xec, 0x8a, 0x5d, 0xcb, 0xb7, 0x4a, 0x6f, 0x2f, + 0xf5, 0x42, 0x5a, 0x77, 0xd6, 0xef, 0xc7, 0x12, 0xb1, 0xab, 0x63, 0x3f, 0x54, 0x9d, 0xb5, 0xd4, + 0x69, 0x92, 0x5c, 0xb4, 0x4a, 0x28, 0x6d, 0x55, 0xec, 0xda, 0x4e, 0xd3, 0x65, 0x7f, 0xbf, 0x9e, + 0x99, 0x8e, 0x4e, 0xaa, 0x3c, 0x2d, 0x3e, 0xcc, 0xca, 0xd6, 0xd7, 0xac, 0x6c, 0xdd, 0x7f, 0x3e, + 0x1f, 0xad, 0xb3, 0xaa, 0x45, 0x52, 0xc8, 0xde, 0xd4, 0x91, 0x18, 0x41, 0x88, 0xb2, 0x79, 0x4d, + 0xb6, 0xdb, 0xa8, 0x9c, 0x4b, 0x92, 0x5f, 0xdf, 0x5b, 0xd9, 0xd4, 0x93, 0x75, 0xbb, 0xb5, 0xff, + 0x14, 0x3f, 0xf9, 0xad, 0xf3, 0xd7, 0x05, 0xb5, 0xe7, 0x0b, 0x6a, 0x7f, 0x2c, 0xa8, 0xfd, 0xb8, + 0xa4, 0xd6, 0x7c, 0x49, 0xad, 0xf7, 0x25, 0xb5, 0xae, 0x98, 0xf2, 0xf5, 0x60, 0xe4, 0xb1, 0x1e, + 0x04, 0x1c, 0x86, 0x50, 0x0f, 0xa5, 0xbe, 0x83, 0xf8, 0x36, 0x99, 0xf9, 0xe4, 0xd7, 0xcb, 0xe9, + 0x69, 0x24, 0xd1, 0xcb, 0xad, 0xfe, 0xee, 0xf1, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0xec, 0xbd, + 0xca, 0xf6, 0x20, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -154,7 +154,7 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { - // SetParams sets the parameters for the gas_estimate module. + // SetParams sets the parameters for the gasestimate module. SetParams(ctx context.Context, in *MsgSetParams, opts ...grpc.CallOption) (*MsgSetParamsResponse, error) } @@ -168,7 +168,7 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { func (c *msgClient) SetParams(ctx context.Context, in *MsgSetParams, opts ...grpc.CallOption) (*MsgSetParamsResponse, error) { out := new(MsgSetParamsResponse) - err := c.cc.Invoke(ctx, "/ojo.gas_estimate.v1.Msg/SetParams", in, out, opts...) + err := c.cc.Invoke(ctx, "/ojo.gasestimate.v1.Msg/SetParams", in, out, opts...) if err != nil { return nil, err } @@ -177,7 +177,7 @@ func (c *msgClient) SetParams(ctx context.Context, in *MsgSetParams, opts ...grp // MsgServer is the server API for Msg service. type MsgServer interface { - // SetParams sets the parameters for the gas_estimate module. + // SetParams sets the parameters for the gasestimate module. SetParams(context.Context, *MsgSetParams) (*MsgSetParamsResponse, error) } @@ -203,7 +203,7 @@ func _Msg_SetParams_Handler(srv interface{}, ctx context.Context, dec func(inter } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ojo.gas_estimate.v1.Msg/SetParams", + FullMethod: "/ojo.gasestimate.v1.Msg/SetParams", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).SetParams(ctx, req.(*MsgSetParams)) @@ -212,7 +212,7 @@ func _Msg_SetParams_Handler(srv interface{}, ctx context.Context, dec func(inter } var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "ojo.gas_estimate.v1.Msg", + ServiceName: "ojo.gasestimate.v1.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { @@ -221,7 +221,7 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "ojo/gas_estimate/v1/tx.proto", + Metadata: "ojo/gasestimate/v1/tx.proto", } func (m *MsgSetParams) Marshal() (dAtA []byte, err error) { diff --git a/x/gmp/module.go b/x/gmp/module.go index de8465f9..5a502808 100644 --- a/x/gmp/module.go +++ b/x/gmp/module.go @@ -171,10 +171,13 @@ func (am AppModule) EndBlock(goCtx context.Context) ([]abci.ValidatorUpdate, err continue } // if the last price has deviated by more than the deviation percentage, trigger an update - if payment.LastPrice.Sub(rate).Abs().GT(payment.Deviation) { - am.keeper.ProcessPayment(goCtx, payment) - } else if payment.LastBlock < ctx.BlockHeight()-payment.Heartbeat { - am.keeper.ProcessPayment(goCtx, payment) + if payment.LastPrice.Sub(rate).Abs().GT(payment.Deviation) || + payment.LastBlock < ctx.BlockHeight()-payment.Heartbeat { + err := am.keeper.ProcessPayment(goCtx, payment) + if err != nil { + ctx.Logger().Error("failed to process payment", "error", err) + continue + } } } diff --git a/x/gmp/types/expected_keeper.go b/x/gmp/types/expected_keeper.go index a6a1662e..a9e2a5e5 100644 --- a/x/gmp/types/expected_keeper.go +++ b/x/gmp/types/expected_keeper.go @@ -7,7 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" - gasestimatetypes "github.com/ojo-network/ojo/x/gas_estimate/types" + gasestimatetypes "github.com/ojo-network/ojo/x/gasestimate/types" oracletypes "github.com/ojo-network/ojo/x/oracle/types" ) diff --git a/x/gmp/types/query.pb.go b/x/gmp/types/query.pb.go index 605513e0..eb258221 100644 --- a/x/gmp/types/query.pb.go +++ b/x/gmp/types/query.pb.go @@ -112,6 +112,7 @@ func (m *ParamsResponse) GetParams() Params { return Params{} } +// AllPaymentsRequest is the request type for the Query/AllPayments RPC method. type AllPaymentsRequest struct { } @@ -148,6 +149,7 @@ func (m *AllPaymentsRequest) XXX_DiscardUnknown() { var xxx_messageInfo_AllPaymentsRequest proto.InternalMessageInfo +// AllPaymentsResponse is the response type for the Query/AllPayments RPC method. type AllPaymentsResponse struct { Payments []Payment `protobuf:"bytes,1,rep,name=payments,proto3" json:"payments"` } @@ -241,6 +243,7 @@ const _ = grpc.SupportPackageIsVersion4 type QueryClient interface { // Params queries all parameters. Params(ctx context.Context, in *ParamsRequest, opts ...grpc.CallOption) (*ParamsResponse, error) + // AllPayments queries all payments. AllPayments(ctx context.Context, in *AllPaymentsRequest, opts ...grpc.CallOption) (*AllPaymentsResponse, error) } @@ -274,6 +277,7 @@ func (c *queryClient) AllPayments(ctx context.Context, in *AllPaymentsRequest, o type QueryServer interface { // Params queries all parameters. Params(context.Context, *ParamsRequest) (*ParamsResponse, error) + // AllPayments queries all payments. AllPayments(context.Context, *AllPaymentsRequest) (*AllPaymentsResponse, error) } diff --git a/x/oracle/types/expected_keeper.go b/x/oracle/types/expected_keeper.go index ed0d1a10..9e3879ad 100644 --- a/x/oracle/types/expected_keeper.go +++ b/x/oracle/types/expected_keeper.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - gasestimatetypes "github.com/ojo-network/ojo/x/gas_estimate/types" + gasestimatetypes "github.com/ojo-network/ojo/x/gasestimate/types" ) // StakingKeeper defines the expected interface contract defined by the x/staking