Skip to content

Commit

Permalink
Merge pull request DongCoNY#41 from onomyprotocol/dong/clean-auction
Browse files Browse the repository at this point in the history
auction: clean auction
  • Loading branch information
vuong177 authored Oct 9, 2024
2 parents bc18005 + 738eca6 commit acaa3b8
Show file tree
Hide file tree
Showing 12 changed files with 127 additions and 92 deletions.
29 changes: 29 additions & 0 deletions proto/reserve/auction/v1/query.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
syntax = "proto3";
package reserve.auction.v1;

import "amino/amino.proto";
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "reserve/auction/v1/params.proto";
import "cosmos_proto/cosmos.proto";

option go_package = "github.com/onomyprotocol/reserve/x/auction/types";

// Query defines the gRPC querier service.
service Query {
// Parameters queries the parameters of the module.
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/reserve/auction/params";
}
}

// QueryParamsRequest is request type for the Query/Params RPC method.
message QueryParamsRequest {}

// QueryParamsResponse is response type for the Query/Params RPC method.
message QueryParamsResponse {
// params holds all the parameters of this module.
Params params = 1
[ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ];
}

2 changes: 1 addition & 1 deletion proto/reserve/auction/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ service Msg {
// MsgUpdateParams is the Msg/UpdateParams request type.
message MsgUpdateParams {
option (cosmos.msg.v1.signer) = "authority";
option (amino.name) = "reserve/x/oracle/MsgUpdateParams";
option (amino.name) = "reserve/x/auction/MsgUpdateParams";

// authority is the address that controls the module (defaults to x/gov unless
// overwritten).
Expand Down
2 changes: 1 addition & 1 deletion x/auction/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/cosmos/cosmos-sdk/client"
// "github.com/cosmos/cosmos-sdk/client/flags"
"github.com/onomyprotocol/reserve/x/oracle/types"
"github.com/onomyprotocol/reserve/x/auction/types"
)

var DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds())
Expand Down
8 changes: 4 additions & 4 deletions x/auction/module/autocli.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package oracle
package auction

import (
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"

modulev1 "github.com/onomyprotocol/reserve/api/reserve/oracle"
"github.com/onomyprotocol/reserve/x/auction/types"
)

// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface.
func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
return &autocliv1.ModuleOptions{
Query: &autocliv1.ServiceCommandDescriptor{
Service: modulev1.Query_ServiceDesc.ServiceName,
Service: types.Query_serviceDesc.ServiceName,
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
{
RpcMethod: "Params",
Expand All @@ -21,7 +21,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
},
Tx: &autocliv1.ServiceCommandDescriptor{
Service: modulev1.Msg_ServiceDesc.ServiceName,
Service: types.Msg_serviceDesc.ServiceName,
EnhanceCustomCommand: true, // only required if you want to use the custom command
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
{
Expand Down
2 changes: 1 addition & 1 deletion x/auction/module/genesis.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package oracle
package auction

import (
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down
2 changes: 1 addition & 1 deletion x/auction/module/genesis_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package oracle_test
package auction_test

import (
"testing"
Expand Down
8 changes: 4 additions & 4 deletions x/auction/module/module.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package oracle
package auction

import (
"context"
Expand Down Expand Up @@ -185,8 +185,8 @@ type ModuleInputs struct {
type ModuleOutputs struct {
depinject.Out

OracleKeeper keeper.Keeper
Module appmodule.AppModule
AuctionKeeper keeper.Keeper
Module appmodule.AppModule
}

func ProvideModule(in ModuleInputs) ModuleOutputs {
Expand All @@ -212,5 +212,5 @@ func ProvideModule(in ModuleInputs) ModuleOutputs {
in.BankKeeper,
)

return ModuleOutputs{OracleKeeper: k, Module: m}
return ModuleOutputs{AuctionKeeper: k, Module: m}
}
8 changes: 4 additions & 4 deletions x/auction/module/simulation.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package oracle
package auction

import (
"math/rand"
Expand All @@ -9,7 +9,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/simulation"

"github.com/onomyprotocol/reserve/testutil/sample"
"github.com/onomyprotocol/reserve/x/oracle/types"
"github.com/onomyprotocol/reserve/x/auction/types"
)

// avoid unused import issue
Expand All @@ -30,11 +30,11 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) {
for i, acc := range simState.Accounts {
accs[i] = acc.Address.String()
}
oracleGenesis := types.GenesisState{
auctionGenesis := types.GenesisState{
Params: types.DefaultParams(),
// this line is used by starport scaffolding # simapp/module/genesisState
}
simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&oracleGenesis)
simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&auctionGenesis)
}

// RegisterStoreDecoder registers a decoder.
Expand Down
6 changes: 6 additions & 0 deletions x/auction/types/msgs.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package types

var (
Query_serviceDesc = _Query_serviceDesc
Msg_serviceDesc = _Msg_serviceDesc
)
72 changes: 36 additions & 36 deletions x/auction/types/query.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions x/auction/types/query.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

76 changes: 38 additions & 38 deletions x/auction/types/tx.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit acaa3b8

Please sign in to comment.