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 service module to cosmos style #1661

Merged
merged 1 commit into from
Feb 16, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
14 changes: 7 additions & 7 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ import (
mesgcodec "github.com/mesg-foundation/engine/codec"
"github.com/mesg-foundation/engine/cosmos"
executionsdk "github.com/mesg-foundation/engine/sdk/execution"
servicesdk "github.com/mesg-foundation/engine/sdk/service"
"github.com/mesg-foundation/engine/x/instance"
"github.com/mesg-foundation/engine/x/ownership"
"github.com/mesg-foundation/engine/x/process"
"github.com/mesg-foundation/engine/x/runner"
"github.com/mesg-foundation/engine/x/service"
)

const appName = "engine"
Expand Down Expand Up @@ -63,7 +63,7 @@ var (
instance.AppModuleBasic{},
process.AppModuleBasic{},
runner.AppModuleBasic{},
cosmos.NewAppModuleBasic(servicesdk.ModuleName),
service.AppModuleBasic{},
cosmos.NewAppModuleBasic(executionsdk.ModuleName),
)

Expand Down Expand Up @@ -119,7 +119,7 @@ type NewApp struct {
instanceKeeper instance.Keeper
processKeeper process.Keeper
runnerKeeper runner.Keeper
serviceKeeper *servicesdk.Keeper
serviceKeeper service.Keeper
executionKeeper *executionsdk.Keeper

// Module Manager
Expand Down Expand Up @@ -159,7 +159,7 @@ func NewInitApp(
instance.ModuleName,
process.ModuleName,
runner.ModuleName,
servicesdk.ModuleName,
service.ModuleName,
executionsdk.ModuleName,
)

Expand Down Expand Up @@ -245,7 +245,7 @@ func NewInitApp(
app.ownershipKeeper = ownership.NewKeeper(app.cdc, keys[ownership.StoreKey])
app.instanceKeeper = instance.NewKeeper(app.cdc, keys[instance.StoreKey])
app.processKeeper = process.NewKeeper(app.cdc, keys[process.StoreKey], app.instanceKeeper, app.ownershipKeeper)
app.serviceKeeper = servicesdk.NewKeeper(keys[servicesdk.ModuleName], app.ownershipKeeper)
app.serviceKeeper = service.NewKeeper(app.cdc, keys[service.StoreKey], app.ownershipKeeper)
app.runnerKeeper = runner.NewKeeper(app.cdc, keys[runner.StoreKey], app.instanceKeeper)
app.executionKeeper = executionsdk.NewKeeper(keys[executionsdk.ModuleName], app.serviceKeeper, app.instanceKeeper, app.runnerKeeper, app.processKeeper)

Expand All @@ -264,7 +264,7 @@ func NewInitApp(
instance.NewAppModule(app.instanceKeeper),
process.NewAppModule(app.processKeeper),
runner.NewAppModule(app.runnerKeeper, app.instanceKeeper),
servicesdk.NewModule(app.serviceKeeper),
service.NewAppModule(app.serviceKeeper),
executionsdk.NewModule(app.executionKeeper),

staking.NewAppModule(app.stakingKeeper, app.accountKeeper, app.supplyKeeper),
Expand All @@ -291,7 +291,7 @@ func NewInitApp(
instance.ModuleName,
process.ModuleName,
runner.ModuleName,
servicesdk.ModuleName,
service.ModuleName,
executionsdk.ModuleName,

supply.ModuleName,
Expand Down
6 changes: 3 additions & 3 deletions sdk/execution/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ import (
"github.com/mesg-foundation/engine/hash"
"github.com/mesg-foundation/engine/protobuf/api"
"github.com/mesg-foundation/engine/protobuf/types"
servicesdk "github.com/mesg-foundation/engine/sdk/service"
"github.com/mesg-foundation/engine/x/instance"
"github.com/mesg-foundation/engine/x/process"
"github.com/mesg-foundation/engine/x/runner"
"github.com/mesg-foundation/engine/x/service"
)

// Keeper holds the logic to read and write data.
type Keeper struct {
storeKey *cosmostypes.KVStoreKey
serviceKeeper *servicesdk.Keeper
serviceKeeper service.Keeper
instanceKeeper instance.Keeper
runnerKeeper runner.Keeper
processKeeper process.Keeper
}

// NewKeeper initialize a new keeper.
func NewKeeper(storeKey *cosmostypes.KVStoreKey, serviceKeeper *servicesdk.Keeper, instanceKeeper instance.Keeper, runnerKeeper runner.Keeper, processKeeper process.Keeper) *Keeper {
func NewKeeper(storeKey *cosmostypes.KVStoreKey, serviceKeeper service.Keeper, instanceKeeper instance.Keeper, runnerKeeper runner.Keeper, processKeeper process.Keeper) *Keeper {
return &Keeper{
storeKey: storeKey,
serviceKeeper: serviceKeeper,
Expand Down
9 changes: 0 additions & 9 deletions sdk/service/codec.go

This file was deleted.

119 changes: 0 additions & 119 deletions sdk/service/keeper.go

This file was deleted.

67 changes: 0 additions & 67 deletions sdk/service/module.go

This file was deleted.

54 changes: 0 additions & 54 deletions sdk/service/msgs.go

This file was deleted.

Loading