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 runner module to cosmos style #1657

Merged
merged 4 commits into from
Feb 13, 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 @@ -30,10 +30,10 @@ import (
"github.com/mesg-foundation/engine/cosmos"
executionsdk "github.com/mesg-foundation/engine/sdk/execution"
processsdk "github.com/mesg-foundation/engine/sdk/process"
runnersdk "github.com/mesg-foundation/engine/sdk/runner"
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/runner"
)

const appName = "engine"
Expand Down Expand Up @@ -61,8 +61,8 @@ var (
// Engine's AppModuleBasic
ownership.AppModuleBasic{},
instance.AppModuleBasic{},
runner.AppModuleBasic{},
cosmos.NewAppModuleBasic(servicesdk.ModuleName),
cosmos.NewAppModuleBasic(runnersdk.ModuleName),
cosmos.NewAppModuleBasic(executionsdk.ModuleName),
cosmos.NewAppModuleBasic(processsdk.ModuleName),
)
Expand Down Expand Up @@ -117,8 +117,8 @@ type NewApp struct {
// Engine's keepers
ownershipKeeper ownership.Keeper
instanceKeeper instance.Keeper
runnerKeeper runner.Keeper
serviceKeeper *servicesdk.Keeper
runnerKeeper *runnersdk.Keeper
processKeeper *processsdk.Keeper
executionKeeper *executionsdk.Keeper

Expand Down Expand Up @@ -157,8 +157,8 @@ func NewInitApp(
// Engine's module keys
ownership.ModuleName,
instance.ModuleName,
runner.ModuleName,
servicesdk.ModuleName,
runnersdk.ModuleName,
executionsdk.ModuleName,
processsdk.ModuleName,
)
Expand Down Expand Up @@ -244,8 +244,8 @@ func NewInitApp(
// Engine's module keepers
app.ownershipKeeper = ownership.NewKeeper(app.cdc, keys[ownership.StoreKey])
app.instanceKeeper = instance.NewKeeper(app.cdc, keys[instance.StoreKey])
app.runnerKeeper = runner.NewKeeper(app.cdc, keys[runner.StoreKey], app.instanceKeeper)
app.serviceKeeper = servicesdk.NewKeeper(keys[servicesdk.ModuleName], app.ownershipKeeper)
app.runnerKeeper = runnersdk.NewKeeper(keys[runnersdk.ModuleName], app.instanceKeeper)
app.processKeeper = processsdk.NewKeeper(keys[processsdk.ModuleName], app.ownershipKeeper, app.instanceKeeper)
app.executionKeeper = executionsdk.NewKeeper(keys[executionsdk.ModuleName], app.serviceKeeper, app.instanceKeeper, app.runnerKeeper, app.processKeeper)

Expand All @@ -262,8 +262,8 @@ func NewInitApp(
// Engine's modules
ownership.NewAppModule(app.ownershipKeeper),
instance.NewAppModule(app.instanceKeeper),
runner.NewAppModule(app.runnerKeeper, app.instanceKeeper),
servicesdk.NewModule(app.serviceKeeper),
runnersdk.NewModule(app.runnerKeeper),
executionsdk.NewModule(app.executionKeeper),
processsdk.NewModule(app.processKeeper),

Expand All @@ -289,8 +289,8 @@ func NewInitApp(
// Engine's modules
ownership.ModuleName,
instance.ModuleName,
runner.ModuleName,
servicesdk.ModuleName,
runnersdk.ModuleName,
executionsdk.ModuleName,
processsdk.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 @@ -11,22 +11,22 @@ import (
"github.com/mesg-foundation/engine/protobuf/api"
"github.com/mesg-foundation/engine/protobuf/types"
processsdk "github.com/mesg-foundation/engine/sdk/process"
runnersdk "github.com/mesg-foundation/engine/sdk/runner"
servicesdk "github.com/mesg-foundation/engine/sdk/service"
"github.com/mesg-foundation/engine/x/instance"
"github.com/mesg-foundation/engine/x/runner"
)

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

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

This file was deleted.

94 changes: 0 additions & 94 deletions sdk/runner/keeper.go

This file was deleted.

57 changes: 0 additions & 57 deletions sdk/runner/module.go

This file was deleted.

111 changes: 0 additions & 111 deletions sdk/runner/msgs.go

This file was deleted.

Loading