Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: rename module name #282

Merged
merged 6 commits into from
Mar 22, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ import (
"github.com/medibloc/panacea-core/v2/x/burn"
burnkeeper "github.com/medibloc/panacea-core/v2/x/burn/keeper"
burntypes "github.com/medibloc/panacea-core/v2/x/burn/types"
"github.com/medibloc/panacea-core/v2/x/datadeal"
dataDealkeeper "github.com/medibloc/panacea-core/v2/x/datadeal/keeper"
dataDealtypes "github.com/medibloc/panacea-core/v2/x/datadeal/types"
gyuguen marked this conversation as resolved.
Show resolved Hide resolved
"github.com/medibloc/panacea-core/v2/x/did"
didkeeper "github.com/medibloc/panacea-core/v2/x/did/keeper"
didtypes "github.com/medibloc/panacea-core/v2/x/did/types"
"github.com/medibloc/panacea-core/v2/x/market"
marketkeeper "github.com/medibloc/panacea-core/v2/x/market/keeper"
markettypes "github.com/medibloc/panacea-core/v2/x/market/types"
"github.com/medibloc/panacea-core/v2/x/token"
tokenkeeper "github.com/medibloc/panacea-core/v2/x/token/keeper"
tokentypes "github.com/medibloc/panacea-core/v2/x/token/types"
Expand Down Expand Up @@ -184,7 +184,7 @@ var (
token.AppModuleBasic{},
burn.AppModuleBasic{},
wasm.AppModuleBasic{},
market.AppModuleBasic{},
datadeal.AppModuleBasic{},
)

// module account permissions
Expand Down Expand Up @@ -252,15 +252,15 @@ type App struct {
ScopedTransferKeeper capabilitykeeper.ScopedKeeper
ScopedWasmKeeper capabilitykeeper.ScopedKeeper

aolKeeper aolkeeper.Keeper
didKeeper didkeeper.Keeper
burnKeeper burnkeeper.Keeper
tokenKeeper tokenkeeper.Keeper
wasmKeeper wasm.Keeper
marketKeeper marketkeeper.Keeper
aolKeeper aolkeeper.Keeper
didKeeper didkeeper.Keeper
burnKeeper burnkeeper.Keeper
tokenKeeper tokenkeeper.Keeper
wasmKeeper wasm.Keeper
dataDealKeeper dataDealkeeper.Keeper

// the module manager
mm *module.Manager
mm *module.Manager
}

// New returns a reference to an initialized Gaia.
Expand Down Expand Up @@ -290,7 +290,7 @@ func New(
tokentypes.StoreKey,
burntypes.StoreKey,
wasm.StoreKey,
markettypes.StoreKey,
dataDealtypes.StoreKey,
)
tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey)
memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey)
Expand Down Expand Up @@ -432,10 +432,10 @@ func New(
wasmOpts...,
)

app.marketKeeper = *marketkeeper.NewKeeper(
app.dataDealKeeper = *dataDealkeeper.NewKeeper(
appCodec,
keys[markettypes.StoreKey],
keys[markettypes.MemStoreKey],
keys[dataDealtypes.StoreKey],
keys[dataDealtypes.MemStoreKey],
app.BankKeeper,
app.AccountKeeper,
)
Expand Down Expand Up @@ -491,7 +491,7 @@ func New(
token.NewAppModule(appCodec, app.tokenKeeper),
burn.NewAppModule(appCodec, app.burnKeeper),
wasm.NewAppModule(appCodec, &app.wasmKeeper, app.StakingKeeper),
market.NewAppModule(appCodec, app.marketKeeper),
datadeal.NewAppModule(appCodec, app.dataDealKeeper),
)

// During begin block slashing happens after distr.BeginBlocker so that
Expand Down Expand Up @@ -529,7 +529,7 @@ func New(
tokentypes.ModuleName,
burntypes.ModuleName,
wasm.ModuleName,
markettypes.ModuleName,
dataDealtypes.ModuleName,
)

app.mm.RegisterInvariants(&app.CrisisKeeper)
Expand Down Expand Up @@ -740,7 +740,7 @@ func initParamsKeeper(appCodec codec.BinaryMarshaler, legacyAmino *codec.LegacyA
paramsKeeper.Subspace(tokentypes.ModuleName)
paramsKeeper.Subspace(burntypes.ModuleName)
paramsKeeper.Subspace(wasm.ModuleName)
paramsKeeper.Subspace(markettypes.ModuleName)
paramsKeeper.Subspace(dataDealtypes.ModuleName)

return paramsKeeper
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
syntax = "proto3";
package panacea.market.v2;
package panacea.datadeal.v2;

option go_package = "github.com/medibloc/panacea-core/x/market/types";
option go_package = "github.com/medibloc/panacea-core/x/datadeal/types";

import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";
Expand Down
15 changes: 15 additions & 0 deletions proto/panacea/datadeal/v2/genesis.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
syntax = "proto3";
package panacea.datadeal.v2;

option go_package = "github.com/medibloc/panacea-core/x/datadeal/types";

import "panacea/datadeal/v2/deal.proto";
import "google/protobuf/any.proto";
import "panacea/datadeal/v2/tx.proto";

// GenesisState defines the datadeal module's genesis state.
message GenesisState {
map<uint64, Deal> deals = 1;
map<string, DataValidationCertificate> data_certificates = 2;
uint64 next_deal_number = 3;
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
syntax = "proto3";
package panacea.market.v2;
package panacea.datadeal.v2;

import "google/api/annotations.proto";
import "cosmos/base/query/v1beta1/pagination.proto";

import "panacea/market/v2/deal.proto";
import "panacea/datadeal/v2/deal.proto";
import "google/protobuf/any.proto";
import "gogoproto/gogo.proto";

option go_package = "github.com/medibloc/panacea-core/x/market/types";
option go_package = "github.com/medibloc/panacea-core/x/datadeal/types";

// Query defines the gRPC querier service.
service Query {
// Deal returns a Deal.
rpc Deal(QueryDealRequest) returns (QueryDealResponse) {
option (google.api.http).get = "/panacea/deal/v2/deals/{deal_id}";
option (google.api.http).get = "/panacea/datadeal/v2/deals/{deal_id}";
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
syntax = "proto3";
package panacea.market.v2;
package panacea.datadeal.v2;

// this line is used by starport scaffolding # proto/tx/import

option go_package = "github.com/medibloc/panacea-core/x/market/types";
option go_package = "github.com/medibloc/panacea-core/x/datadeal/types";

import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";
Expand Down
15 changes: 0 additions & 15 deletions proto/panacea/market/v2/genesis.proto

This file was deleted.

36 changes: 18 additions & 18 deletions types/testsuite/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (
aolkeeper "github.com/medibloc/panacea-core/v2/x/aol/keeper"
aoltypes "github.com/medibloc/panacea-core/v2/x/aol/types"
burnkeeper "github.com/medibloc/panacea-core/v2/x/burn/keeper"
marketkeeper "github.com/medibloc/panacea-core/v2/x/market/keeper"
markettypes "github.com/medibloc/panacea-core/v2/x/market/types"
dataDealkeeper "github.com/medibloc/panacea-core/v2/x/datadeal/keeper"
dataDealtypes "github.com/medibloc/panacea-core/v2/x/datadeal/types"
tokenkeeper "github.com/medibloc/panacea-core/v2/x/token/keeper"
tokentypes "github.com/medibloc/panacea-core/v2/x/token/types"
"github.com/stretchr/testify/suite"
Expand All @@ -38,16 +38,16 @@ type TestSuite struct {

Ctx sdk.Context

AccountKeeper authkeeper.AccountKeeper
AolKeeper aolkeeper.Keeper
AolMsgServer aoltypes.MsgServer
BankKeeper bankkeeper.Keeper
BurnKeeper burnkeeper.Keeper
DIDMsgServer didtypes.MsgServer
DIDKeeper didkeeper.Keeper
TokenKeeper tokenkeeper.Keeper
MarketKeeper marketkeeper.Keeper
MarketMsgServer markettypes.MsgServer
AccountKeeper authkeeper.AccountKeeper
AolKeeper aolkeeper.Keeper
AolMsgServer aoltypes.MsgServer
BankKeeper bankkeeper.Keeper
BurnKeeper burnkeeper.Keeper
DIDMsgServer didtypes.MsgServer
DIDKeeper didkeeper.Keeper
TokenKeeper tokenkeeper.Keeper
DataDealKeeper dataDealkeeper.Keeper
DataDealMsgServer dataDealtypes.MsgServer
}

func (suite *TestSuite) SetupTest() {
Expand All @@ -58,7 +58,7 @@ func (suite *TestSuite) SetupTest() {
paramstypes.StoreKey,
didtypes.StoreKey,
tokentypes.StoreKey,
markettypes.StoreKey)
dataDealtypes.StoreKey)
tKeyParams := sdk.NewTransientStoreKey(paramstypes.TStoreKey)
memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey)

Expand Down Expand Up @@ -128,13 +128,13 @@ func (suite *TestSuite) SetupTest() {
suite.BankKeeper,
)

suite.MarketKeeper = *marketkeeper.NewKeeper(
suite.DataDealKeeper = *dataDealkeeper.NewKeeper(
cdc.Marshaler,
keyParams[markettypes.StoreKey],
memKeys[markettypes.MemStoreKey],
keyParams[dataDealtypes.StoreKey],
memKeys[dataDealtypes.MemStoreKey],
suite.BankKeeper,
suite.AccountKeeper)
suite.MarketMsgServer = marketkeeper.NewMsgServerImpl(suite.MarketKeeper)
suite.DataDealMsgServer = dataDealkeeper.NewMsgServerImpl(suite.DataDealKeeper)
}

func (suite *TestSuite) BeforeTest(suiteName, testName string) {
Expand All @@ -152,7 +152,7 @@ func newTestCodec() params.EncodingConfig {
banktypes.RegisterInterfaces(interfaceRegistry)
cryptocodec.RegisterInterfaces(interfaceRegistry)
didtypes.RegisterInterfaces(interfaceRegistry)
markettypes.RegisterInterfaces(interfaceRegistry)
dataDealtypes.RegisterInterfaces(interfaceRegistry)
marshaler := codec.NewProtoCodec(interfaceRegistry)

return params.EncodingConfig{
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import (
// "github.com/cosmos/cosmos-sdk/client/flags"
// sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/medibloc/panacea-core/v2/x/market/types"
"github.com/medibloc/panacea-core/v2/x/datadeal/types"
)

// GetQueryCmd returns the cli query commands for this module
func GetQueryCmd(queryRoute string) *cobra.Command {
// Group market queries under a subcommand
// Group datadeal queries under a subcommand
cmd := &cobra.Command{
Use: types.ModuleName,
Short: fmt.Sprintf("Querying commands for the %s module", types.ModuleName),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cli
import (
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/medibloc/panacea-core/v2/x/market/types"
"github.com/medibloc/panacea-core/v2/x/datadeal/types"
"github.com/spf13/cobra"
"strconv"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cli
import (
"fmt"
"github.com/cosmos/cosmos-sdk/client"
"github.com/medibloc/panacea-core/v2/x/market/types"
"github.com/medibloc/panacea-core/v2/x/datadeal/types"
"github.com/spf13/cobra"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/cosmos/cosmos-sdk/client/tx"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/gogo/protobuf/jsonpb"
"github.com/medibloc/panacea-core/v2/x/market/types"
"github.com/medibloc/panacea-core/v2/x/datadeal/types"
"github.com/spf13/cobra"
flag "github.com/spf13/pflag"
"io/ioutil"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cli

import (
"encoding/base64"
"github.com/medibloc/panacea-core/v2/x/market/types"
"github.com/medibloc/panacea-core/v2/x/datadeal/types"
"github.com/stretchr/testify/require"
"testing"
)
Expand Down
6 changes: 3 additions & 3 deletions x/market/genesis.go → x/datadeal/genesis.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package market
package datadeal

import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/medibloc/panacea-core/v2/x/market/keeper"
"github.com/medibloc/panacea-core/v2/x/market/types"
"github.com/medibloc/panacea-core/v2/x/datadeal/keeper"
"github.com/medibloc/panacea-core/v2/x/datadeal/types"
)

// InitGenesis initializes the capability module's state from a provided genesis
Expand Down
Loading