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

fork v4_5_1 remove rate limit: #225

Merged
merged 2 commits into from
Aug 18, 2023
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
3 changes: 2 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
v4_5 "github.com/notional-labs/centauri/v4/app/upgrades/v4_5"
v4_5_1 "github.com/notional-labs/centauri/v4/app/upgrades/v4_5_1"

upgrades "github.com/notional-labs/centauri/v4/app/upgrades"
)
Expand All @@ -133,7 +134,7 @@
EnableSpecificProposals = ""

Upgrades = []upgrades.Upgrade{v4.Upgrade}
Forks = []upgrades.Fork{v4_5.Fork}
Forks = []upgrades.Fork{v4_5.Fork, v4_5_1.Fork}
)

// GetEnabledProposals parses the ProposalsEnabled / EnableSpecificProposals values to
Expand Down Expand Up @@ -701,7 +702,7 @@
}

func (app *CentauriApp) customPreUpgradeHandler(upgradeInfo upgradetypes.Plan) {
switch upgradeInfo.Name {

Check failure on line 705 in app/app.go

View workflow job for this annotation

GitHub Actions / lint

singleCaseSwitch: found switch with default case only (gocritic)
default:
}
}
Expand Down
18 changes: 18 additions & 0 deletions app/upgrades/v4_5_1/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package v4_5_1

import "github.com/notional-labs/centauri/v4/app/upgrades"

const (
// UpgradeName defines the on-chain upgrade name for the Composable v5 upgrade.
UpgradeName = "v4_5_1"

// UpgradeHeight defines the block height at which the Composable v6 upgrade is
// triggered.
UpgradeHeight = 1_117_000
)

var Fork = upgrades.Fork{
UpgradeName: UpgradeName,
UpgradeHeight: UpgradeHeight,
BeginForkLogic: RunForkLogic,
}
26 changes: 26 additions & 0 deletions app/upgrades/v4_5_1/fork.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package v4_5_1

import (
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/notional-labs/centauri/v4/app/keepers"
rateLimitKeeper "github.com/notional-labs/centauri/v4/x/ratelimit/keeper"
)

func RunForkLogic(ctx sdk.Context, keepers *keepers.AppKeepers) {
ctx.Logger().Info("Applying v5 upgrade" +
"Remove Rate Limit",
)
}

func RemoveRateLimit(ctx sdk.Context, rlKeeper *rateLimitKeeper.Keeper) {
// Get all current rate limit
rateLimits := rlKeeper.GetAllRateLimits(ctx)
// Remove Rate limit
for _, rateLimit := range rateLimits {
err := rlKeeper.RemoveRateLimit(ctx, rateLimit.Path.Denom, rateLimit.Path.ChannelId)
if err != nil {
panic(err)
}
}
}
Loading