Skip to content

Commit

Permalink
fix: added pob queries to swagger and init module with default params
Browse files Browse the repository at this point in the history
  • Loading branch information
javiersuweijie committed Sep 18, 2023
1 parent 083c8ec commit dbd599b
Show file tree
Hide file tree
Showing 6 changed files with 254 additions and 23 deletions.
1 change: 1 addition & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,7 @@ func (app *TerraApp) RegisterUpgradeHandlers(cfg module.Configurator) {
app.ParamsKeeper,
app.ConsensusParamsKeeper,
app.ICAControllerKeeper,
app.BuilderKeeper,
),
)
}
Expand Down
21 changes: 20 additions & 1 deletion app/upgrades/v2.5/upgrade.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package v2_5

import (
pobkeeper "github.com/skip-mev/pob/x/builder/keeper"
pobtypes "github.com/skip-mev/pob/x/builder/types"
"time"

sdkerrors "cosmossdk.io/errors"
Expand Down Expand Up @@ -28,6 +30,7 @@ func CreateUpgradeHandler(
paramsKeeper paramskeeper.Keeper,
consensusParamsKeeper consensuskeeper.Keeper,
icacontrollerKeeper icacontrollerkeeper.Keeper,
pobKeeper pobkeeper.Keeper,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
// READ: https://github.com/cosmos/cosmos-sdk/blob/v0.47.4/UPGRADING.md#xconsensus
Expand All @@ -52,8 +55,24 @@ func CreateUpgradeHandler(

// READ: https://github.com/terra-money/core/issues/166
icacontrollerKeeper.SetParams(ctx, icacontrollertypes.DefaultParams())
vm, err := mm.RunMigrations(ctx, cfg, fromVM)
if err != nil {
return nil, err
}

return mm.RunMigrations(ctx, cfg, fromVM)
// Setting pob params to disable by default until a proposal is passed to enable it
err = pobKeeper.SetParams(ctx, pobtypes.Params{
MaxBundleSize: 0,
EscrowAccountAddress: pobtypes.DefaultEscrowAccountAddress,
ReserveFee: sdk.NewCoin("uluna", sdk.NewInt(1)),
MinBidIncrement: sdk.NewCoin("uluna", sdk.NewInt(1)),
FrontRunningProtection: pobtypes.DefaultFrontRunningProtection,
ProposerFee: pobtypes.DefaultProposerFee,
})
if err != nil {
return nil, err
}
return vm, nil
}
}

Expand Down
10 changes: 9 additions & 1 deletion client/docs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"apis": [
{
"url": "./tmp-swagger-gen/alliance/query.swagger.json",
"url": "./tmp-swagger-gen/alliance/alliance/query.swagger.json",
"operationIds": {
"rename": {
"Params": "AllianceParams"
Expand Down Expand Up @@ -236,6 +236,14 @@
"Params": "IBCRouterParams"
}
}
},
{
"url": "./tmp-swagger-gen/pob/builder/v1/query.swagger.json",
"operationIds": {
"rename": {
"Params": "PobParams"
}
}
}
]
}
2 changes: 1 addition & 1 deletion client/docs/statik/statik.go

Large diffs are not rendered by default.

Loading

0 comments on commit dbd599b

Please sign in to comment.