forked from ComposableFi/picasso
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fork v4_5_1 remove rate limit: (ComposableFi#225)
* fork v5 remove rate limit: * add to Fork list
- Loading branch information
Showing
3 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} | ||
} |