-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
78 additions
and
17 deletions.
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,10 @@ | ||
package ceers2112 | ||
|
||
import ( | ||
"github.com/milkyway-labs/milkyway/v3/app/forks" | ||
) | ||
|
||
var Fork = forks.Fork{ | ||
ForkHeight: 301230, | ||
BeginForkLogic: BeginFork, | ||
} |
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,29 @@ | ||
package ceers2112 | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
|
||
"github.com/milkyway-labs/milkyway/v3/app/keepers" | ||
) | ||
|
||
func BeginFork(ctx sdk.Context, keepers *keepers.AppKeepers) { | ||
ctx.Logger().Debug(` | ||
=================================================================================================== | ||
==== Forking chain state | ||
=================================================================================================== | ||
`) | ||
|
||
// Update the gov params to make sure the min deposit amount is set to stake | ||
params, err := keepers.GovKeeper.Params.Get(ctx) | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
params.MinDeposit = sdk.NewCoins(sdk.NewInt64Coin("stake", 1000000)) | ||
params.ExpeditedMinDeposit = sdk.NewCoins(sdk.NewInt64Coin("stake", 5000000)) | ||
|
||
err = keepers.GovKeeper.Params.Set(ctx, params) | ||
if err != nil { | ||
panic(err) | ||
} | ||
} |
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,20 @@ | ||
package forks | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
|
||
"github.com/milkyway-labs/milkyway/v3/app/keepers" | ||
) | ||
|
||
// Fork defines a struct containing the requisite fields for a non-software upgrade proposal | ||
// Hard Fork at a given height to implement. | ||
// There is one time code that can be added for the start of the Fork, in `BeginForkLogic`. | ||
// Any other change in the code should be height-gated, if the goal is to have old and new binaries | ||
// to be compatible prior to the upgrade height. | ||
type Fork struct { | ||
// ForkHeight represents the height the upgrade occurs at | ||
ForkHeight int64 | ||
|
||
// Function that runs some custom state transition code at the beginning of a fork. | ||
BeginForkLogic func(ctx sdk.Context, keepers *keepers.AppKeepers) | ||
} |
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