Skip to content

Commit

Permalink
refactor: update reward delay time
Browse files Browse the repository at this point in the history
  • Loading branch information
hoank101 committed Mar 4, 2024
1 parent 5faf4a1 commit 6b1b3b3
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 152 deletions.
4 changes: 2 additions & 2 deletions app/forks.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package app

import (
v4 "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/app/upgrades/v4_1_1"
v4 "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/app/upgrades/v4_1_2"
sdk "github.com/cosmos/cosmos-sdk/types"
)

// BeginBlockForks executes any necessary fork logic based upon the current block height.
func BeginBlockForks(ctx sdk.Context, app *MigalooApp) {
if ctx.BlockHeight() == v4.UpgradeHeight {
v4.UpdateAccountPermissionAndFeeBurnPercent(ctx, app.FeeBurnKeeper, app.AccountKeeper)
v4.UpdateAlliance(ctx, app.AllianceKeeper)
}
}
14 changes: 0 additions & 14 deletions app/upgrades/v3_0_2/constants.go

This file was deleted.

17 changes: 0 additions & 17 deletions app/upgrades/v3_0_2/upgrades.go

This file was deleted.

5 changes: 0 additions & 5 deletions app/upgrades/v4_1_0/constants.go

This file was deleted.

42 changes: 0 additions & 42 deletions app/upgrades/v4_1_0/upgrades.go

This file was deleted.

45 changes: 0 additions & 45 deletions app/upgrades/v4_1_0/upgrades_test.go

This file was deleted.

5 changes: 0 additions & 5 deletions app/upgrades/v4_1_1/constants.go

This file was deleted.

22 changes: 0 additions & 22 deletions app/upgrades/v4_1_1/upgrades.go

This file was deleted.

5 changes: 5 additions & 0 deletions app/upgrades/v4_1_2/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package v4

const (
UpgradeHeight = 777300
)
22 changes: 22 additions & 0 deletions app/upgrades/v4_1_2/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package v4

import (
sdk "github.com/cosmos/cosmos-sdk/types"
alliancekeeper "github.com/terra-money/alliance/x/alliance/keeper"
"time"
)

func UpdateAlliance(ctx sdk.Context, alk alliancekeeper.Keeper) {
allianceParams := alk.GetParams(ctx)
allianceParams.RewardDelayTime = 10 * time.Minute

_ = alk.SetParams(ctx, allianceParams)

asset, found := alk.GetAssetByDenom(ctx, "ibc/30E9709461C4DA26A7A579E11DE44B591E676DB1B7F94714FBFF87ED6E47D6F4")
if found {
rewardStartTime := ctx.BlockTime()
asset.LastRewardChangeTime = rewardStartTime
asset.RewardStartTime = rewardStartTime
alk.SetAsset(ctx, asset)
}
}

0 comments on commit 6b1b3b3

Please sign in to comment.