Skip to content

Commit

Permalink
feat: add budget module on simapp (#118)
Browse files Browse the repository at this point in the history
* feat: add global keys prefix for the current epoch days

* test: add test for key store prefixes

* chore: fix broken store prefix test, rename EpochDays to NextEpochDays

* test: add more tests and update address to have 20 bytes

* test: remove comments

* test: update epoch days to next epoch days

* test: add handler tests

* refactor: add comment for global current epoch days

* test: apply module testing suit

* test: remove tests for deprecated PlansByFarmerIndex

* feat: move mustParseRFC3339 function to utils #109

* docs: update spec docs

* feat: adding test for end blocker

* chore: rename GlobalCurrentEpochDays to CurrentEpochDays and refactor codes

* test: improve code coverage

* chore: apply code review feedbacks and suggestions

* feat: add gRPC query and cli for current epoch days

* feat: add budget module on simapp

* fix: apply code review feedbacks and suggestions

* fix: resolve conflicts

* fix: gov simulation issue from budget

* update: bump budget module version to latest

* test: set no-race for cli_test

* fix: refactor last_epoch_time

Co-authored-by: kogisin <[email protected]>
  • Loading branch information
dongsam and jaybxyz authored Sep 16, 2021
1 parent f03a6b8 commit e64f916
Show file tree
Hide file tree
Showing 14 changed files with 83 additions and 62 deletions.
41 changes: 24 additions & 17 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/gorilla/mux"
"github.com/rakyll/statik/fs"
"github.com/spf13/cast"
"github.com/tendermint/budget/x/budget"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
tmos "github.com/tendermint/tendermint/libs/os"
Expand Down Expand Up @@ -85,6 +86,9 @@ import (
upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

budgetkeeper "github.com/tendermint/budget/x/budget/keeper"
budgettypes "github.com/tendermint/budget/x/budget/types"

farmingparams "github.com/tendermint/farming/app/params"
"github.com/tendermint/farming/x/farming"
farmingclient "github.com/tendermint/farming/x/farming/client"
Expand Down Expand Up @@ -125,8 +129,8 @@ var (
evidence.AppModuleBasic{},
authzmodule.AppModuleBasic{},
vesting.AppModuleBasic{},
budget.AppModuleBasic{},
farming.AppModuleBasic{},
// todo: farming ordering
)

// module account permissions
Expand All @@ -137,8 +141,9 @@ var (
stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking},
stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking},
govtypes.ModuleName: {authtypes.Burner},
farmingtypes.ModuleName: {authtypes.Minter},
// todo: farming Staking Reserve Coin TBD
budgettypes.ModuleName: nil,
// TODO: remove minter permission for farming module, currently it used only for simulation
farmingtypes.ModuleName: {authtypes.Minter},
}
)

Expand Down Expand Up @@ -176,6 +181,7 @@ type FarmingApp struct {
AuthzKeeper authzkeeper.Keeper
EvidenceKeeper evidencekeeper.Keeper
FeeGrantKeeper feegrantkeeper.Keeper
BudgetKeeper budgetkeeper.Keeper
FarmingKeeper farmingkeeper.Keeper

// the module manager
Expand Down Expand Up @@ -217,7 +223,7 @@ func NewFarmingApp(
authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey,
minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey,
govtypes.StoreKey, paramstypes.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey,
evidencetypes.StoreKey, capabilitytypes.StoreKey, authzkeeper.StoreKey, farmingtypes.StoreKey,
evidencetypes.StoreKey, capabilitytypes.StoreKey, authzkeeper.StoreKey, budgettypes.StoreKey, farmingtypes.StoreKey,
)
tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey)
memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey)
Expand Down Expand Up @@ -282,11 +288,15 @@ func NewFarmingApp(

app.AuthzKeeper = authzkeeper.NewKeeper(keys[authzkeeper.StoreKey], appCodec, app.BaseApp.MsgServiceRouter())

app.BudgetKeeper = budgetkeeper.NewKeeper(
appCodec, keys[budgettypes.StoreKey], app.GetSubspace(budgettypes.ModuleName), app.AccountKeeper,
app.BankKeeper, app.ModuleAccountAddrs(),
)

app.FarmingKeeper = farmingkeeper.NewKeeper(
appCodec, keys[farmingtypes.StoreKey], app.GetSubspace(farmingtypes.ModuleName), app.AccountKeeper,
app.BankKeeper, app.ModuleAccountAddrs(),
)
// todo: farming ordering

// register the proposal types
govRouter := govtypes.NewRouter()
Expand All @@ -295,7 +305,6 @@ func NewFarmingApp(
AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)).
AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)).
AddRoute(farmingtypes.RouterKey, farming.NewPublicPlanProposal(app.FarmingKeeper))
// todo: implementing...

govKeeper := govkeeper.NewKeeper(
appCodec, keys[govtypes.StoreKey], app.GetSubspace(govtypes.ModuleName), app.AccountKeeper, app.BankKeeper,
Expand Down Expand Up @@ -338,14 +347,14 @@ func NewFarmingApp(
gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper),
mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper),
slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper),
budget.NewAppModule(appCodec, app.BudgetKeeper, app.AccountKeeper, app.BankKeeper),
distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper),
staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper),
upgrade.NewAppModule(app.UpgradeKeeper),
evidence.NewAppModule(app.EvidenceKeeper),
params.NewAppModule(app.ParamsKeeper),
authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
farming.NewAppModule(appCodec, app.FarmingKeeper, app.AccountKeeper, app.BankKeeper, app.DistrKeeper),
// todo: farming ordering
farming.NewAppModule(appCodec, app.FarmingKeeper, app.AccountKeeper, app.BankKeeper),
)

// During begin block slashing happens after distr.BeginBlocker so that
Expand All @@ -354,15 +363,13 @@ func NewFarmingApp(
// NOTE: staking module is required if HistoricalEntries param > 0
// NOTE: capability module's beginblocker must come before any modules using capabilities (e.g. IBC)
app.mm.SetOrderBeginBlockers(
upgradetypes.ModuleName, capabilitytypes.ModuleName, minttypes.ModuleName, distrtypes.ModuleName, slashingtypes.ModuleName,
evidencetypes.ModuleName, stakingtypes.ModuleName, farmingtypes.ModuleName,
// todo: farming ordering
upgradetypes.ModuleName, capabilitytypes.ModuleName, minttypes.ModuleName, budgettypes.ModuleName, distrtypes.ModuleName, slashingtypes.ModuleName,
evidencetypes.ModuleName, stakingtypes.ModuleName,
)

app.mm.SetOrderEndBlockers(
crisistypes.ModuleName, govtypes.ModuleName,
stakingtypes.ModuleName, farmingtypes.ModuleName,
// todo: farming ordering
)

// NOTE: The genutils module must occur after staking so that pools are
Expand All @@ -374,8 +381,7 @@ func NewFarmingApp(
capabilitytypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, distrtypes.ModuleName,
stakingtypes.ModuleName, slashingtypes.ModuleName, govtypes.ModuleName, minttypes.ModuleName,
crisistypes.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, authz.ModuleName,
feegrant.ModuleName, farmingtypes.ModuleName,
// todo: farming ordering
feegrant.ModuleName, budgettypes.ModuleName, farmingtypes.ModuleName,
)

app.mm.RegisterInvariants(&app.CrisisKeeper)
Expand All @@ -397,14 +403,15 @@ func NewFarmingApp(
feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry),
gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper),
mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper),
budget.NewAppModule(appCodec, app.BudgetKeeper, app.AccountKeeper, app.BankKeeper),
staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper),
distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper),
slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper),
params.NewAppModule(app.ParamsKeeper),
evidence.NewAppModule(app.EvidenceKeeper),
authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
farming.NewAppModule(appCodec, app.FarmingKeeper, app.AccountKeeper, app.BankKeeper, app.DistrKeeper),
// todo: farming ordering
budget.NewAppModule(appCodec, app.BudgetKeeper, app.AccountKeeper, app.BankKeeper),
farming.NewAppModule(appCodec, app.FarmingKeeper, app.AccountKeeper, app.BankKeeper),
)

app.sm.RegisterStoreDecoders()
Expand Down Expand Up @@ -602,7 +609,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govtypes.ParamKeyTable())
paramsKeeper.Subspace(crisistypes.ModuleName)
paramsKeeper.Subspace(farmingtypes.ModuleName)
// todo: farming ordering
paramsKeeper.Subspace(budgettypes.ModuleName)

return paramsKeeper
}
3 changes: 3 additions & 0 deletions app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/require"
"github.com/tendermint/budget/x/budget"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/tests/mocks"
Expand Down Expand Up @@ -187,6 +188,7 @@ func TestRunMigrations(t *testing.T) {
"crisis": crisis.AppModule{}.ConsensusVersion(),
"genutil": genutil.AppModule{}.ConsensusVersion(),
"capability": capability.AppModule{}.ConsensusVersion(),
"budget": budget.AppModule{}.ConsensusVersion(),
"farming": farming.AppModule{}.ConsensusVersion(),
},
)
Expand Down Expand Up @@ -240,6 +242,7 @@ func TestInitGenesisOnMigration(t *testing.T) {
"crisis": crisis.AppModule{}.ConsensusVersion(),
"genutil": genutil.AppModule{}.ConsensusVersion(),
"capability": capability.AppModule{}.ConsensusVersion(),
"budget": budget.AppModule{}.ConsensusVersion(),
"farming": farming.AppModule{}.ConsensusVersion(),
},
)
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ require (
github.com/spf13/cobra v1.1.3
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.7.0
github.com/tendermint/budget v0.0.0-20210916135401-7d1b338fa02d
github.com/tendermint/tendermint v0.34.12
github.com/tendermint/tm-db v0.6.4
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,8 @@ github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzH
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8=
github.com/tendermint/btcd v0.1.1 h1:0VcxPfflS2zZ3RiOAHkBiFUcPvbtRj5O7zHmcJWHV7s=
github.com/tendermint/btcd v0.1.1/go.mod h1:DC6/m53jtQzr/NFmMNEu0rxf18/ktVoVtMrnDD5pN+U=
github.com/tendermint/budget v0.0.0-20210916135401-7d1b338fa02d h1:d8DzeS7BmajE8/IbYvns4vDtgJ6RJRkrLU1T1+N5bn8=
github.com/tendermint/budget v0.0.0-20210916135401-7d1b338fa02d/go.mod h1:49m91ZgK5qDsIXs5EHNeBrXXrb3XXaDQuFWvmiKxyyY=
github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 h1:hqAk8riJvK4RMWx1aInLzndwxKalgi5rTqgfXxOxbEI=
github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15/go.mod h1:z4YtwM70uOnk8h0pjJYlj3zdYwi9l03By6iAIF5j/Pk=
github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E=
Expand Down
10 changes: 5 additions & 5 deletions proto/tendermint/farming/v1beta1/farming.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ message Params {
// private_plan_creation_fee specifies the fee for plan creation
// this fee prevents from spamming and it is collected in the community pool
repeated cosmos.base.v1beta1.Coin private_plan_creation_fee = 1 [
(gogoproto.moretags) = "yaml:\"private_plan_creation_fee\"",
(gogoproto.moretags) = "yaml:\"private_plan_creation_fee\"",
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
(gogoproto.nullable) = false
(gogoproto.nullable) = false
];

// next_epoch_days is the epoch length in number of days
Expand Down Expand Up @@ -160,15 +160,15 @@ message HistoricalRewards {
option (gogoproto.goproto_getters) = false;

repeated cosmos.base.v1beta1.DecCoin cumulative_unit_rewards = 1 [
(gogoproto.moretags) = "yaml:\"cumulative_unit_rewards\"",
(gogoproto.moretags) = "yaml:\"cumulative_unit_rewards\"",
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins",
(gogoproto.nullable) = false
(gogoproto.nullable) = false
];
}

// OutstandingRewards represents outstanding(un-withdrawn) rewards
// for a staking coin denom.
message OutstandingRewards {
repeated cosmos.base.v1beta1.DecCoin rewards = 1
[(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false];
[(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false];
}
28 changes: 14 additions & 14 deletions proto/tendermint/farming/v1beta1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -24,39 +24,39 @@ message GenesisState {
repeated PlanRecord plan_records = 2 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"plan_records\""];

repeated StakingRecord staking_records = 3
[(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"staking_records\""];
[(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"staking_records\""];

repeated QueuedStakingRecord queued_staking_records = 4
[(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"queued_staking_records\""];
[(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"queued_staking_records\""];

repeated HistoricalRewardsRecord historical_rewards_records = 5
[(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"historical_rewards_records\""];
[(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"historical_rewards_records\""];

repeated OutstandingRewardsRecord outstanding_rewards_records = 6
[(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"outstanding_rewards_records\""];
[(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"outstanding_rewards_records\""];

repeated CurrentEpochRecord current_epoch_records = 7
[(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"current_epoch_records\""];
[(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"current_epoch_records\""];

// staking_reserve_coins specifies balance of the staking reserve pool staked in the plans
// this param is needed for import/export validation
repeated cosmos.base.v1beta1.Coin staking_reserve_coins = 8 [
(gogoproto.moretags) = "yaml:\"staking_reserve_coins\"",
(gogoproto.moretags) = "yaml:\"staking_reserve_coins\"",
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
(gogoproto.nullable) = false
(gogoproto.nullable) = false
];

// reward_pool_coins specifies balance of the reward pool to be distributed in the plans
// this param is needed for import/export validation
repeated cosmos.base.v1beta1.Coin reward_pool_coins = 9 [
(gogoproto.moretags) = "yaml:\"reward_pool_coins\"",
(gogoproto.moretags) = "yaml:\"reward_pool_coins\"",
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
(gogoproto.nullable) = false
(gogoproto.nullable) = false
];

// last_epoch_time specifies the last executed epoch time of the plans
google.protobuf.Timestamp last_epoch_time = 10
[(gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"last_epoch_time\""];
[(gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"last_epoch_time\""];

// current_epoch_days specifies the epoch used when allocating farming rewards in end blocker
uint32 current_epoch_days = 11;
Expand Down Expand Up @@ -118,21 +118,21 @@ message HistoricalRewardsRecord {
uint64 epoch = 2;

HistoricalRewards historical_rewards = 3
[(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"historical_rewards\""];
[(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"historical_rewards\""];
}

message OutstandingRewardsRecord {
option (gogoproto.equal) = false;
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;

string staking_coin_denom = 1 [(gogoproto.moretags) = "yaml:\"staking_coin_denom\""];

OutstandingRewards outstanding_rewards = 2
[(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"outstanding_rewards\""];
[(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"outstanding_rewards\""];
}

message CurrentEpochRecord {
option (gogoproto.equal) = false;
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;

string staking_coin_denom = 1 [(gogoproto.moretags) = "yaml:\"staking_coin_denom\""];
Expand Down
10 changes: 5 additions & 5 deletions proto/tendermint/farming/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ message QueryPlanResponse {
}

message QueryStakingsRequest {
string farmer = 1;
string farmer = 1;
string staking_coin_denom = 2;
}

message QueryStakingsResponse {
repeated cosmos.base.v1beta1.Coin staked_coins = 1
[(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false];
[(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false];
repeated cosmos.base.v1beta1.Coin queued_coins = 2
[(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false];
[(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false];
}

message QueryTotalStakingsRequest {
Expand All @@ -102,13 +102,13 @@ message QueryTotalStakingsResponse {
}

message QueryRewardsRequest {
string farmer = 1;
string farmer = 1;
string staking_coin_denom = 2;
}

message QueryRewardsResponse {
repeated cosmos.base.v1beta1.Coin rewards = 1
[(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false];
[(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false];
}

// QueryCurrentEpochDaysRequest is the request type for the Query/CurrentEpochDays RPC method.
Expand Down
4 changes: 2 additions & 2 deletions x/farming/keeper/epoch.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

func (k Keeper) GetLastEpochTime(ctx sdk.Context) (time.Time, bool) {
store := ctx.KVStore(k.storeKey)
bz := store.Get(types.GlobalLastEpochTimeKey)
bz := store.Get(types.LastEpochTimeKey)
if bz == nil {
return time.Time{}, false
}
Expand All @@ -32,7 +32,7 @@ func (k Keeper) SetLastEpochTime(ctx sdk.Context, t time.Time) {
panic(err)
}
bz := k.cdc.MustMarshal(ts)
store.Set(types.GlobalLastEpochTimeKey, bz)
store.Set(types.LastEpochTimeKey, bz)
}

func (k Keeper) AdvanceEpoch(ctx sdk.Context) error {
Expand Down
11 changes: 2 additions & 9 deletions x/farming/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper"

//"github.com/tendermint/farming/x/farming/client/rest"
"github.com/tendermint/farming/x/farming/client/cli"
"github.com/tendermint/farming/x/farming/keeper"
Expand Down Expand Up @@ -64,10 +62,7 @@ func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config sdkclient.TxEn
}

// RegisterRESTRoutes registers the REST routes for the farming module.
func (AppModuleBasic) RegisterRESTRoutes(clientCtx sdkclient.Context, rtr *mux.Router) {
// TODO: unimplemented
//rest.RegisterHandlers(clientCtx, rtr)
}
func (AppModuleBasic) RegisterRESTRoutes(_ sdkclient.Context, _ *mux.Router) {}

// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the farming module.
func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx sdkclient.Context, mux *runtime.ServeMux) {
Expand Down Expand Up @@ -98,20 +93,18 @@ type AppModule struct {
keeper keeper.Keeper
accountKeeper types.AccountKeeper
bankKeeper types.BankKeeper
distrKeeper distrkeeper.Keeper
}

// NewAppModule creates a new AppModule object
func NewAppModule(
cdc codec.Codec, keeper keeper.Keeper, accountKeeper types.AccountKeeper,
bankKeeper types.BankKeeper, distrKeeper distrkeeper.Keeper,
bankKeeper types.BankKeeper,
) AppModule {
return AppModule{
AppModuleBasic: AppModuleBasic{cdc: cdc},
keeper: keeper,
accountKeeper: accountKeeper,
bankKeeper: bankKeeper,
distrKeeper: distrKeeper,
}
}

Expand Down
Loading

0 comments on commit e64f916

Please sign in to comment.