-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #296 from faultytolly/feature/expedited-proposals
feat: update SDK to fork with expedited proposals
- Loading branch information
Showing
5 changed files
with
61 additions
and
11 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,13 @@ | ||
package v3 | ||
|
||
import ( | ||
"github.com/sge-network/sge/app/upgrades" | ||
) | ||
|
||
// UpgradeName defines the on-chain upgrade name for the v1.1.2 upgrade. | ||
const UpgradeName = "v1.1.2" | ||
|
||
var Upgrade = upgrades.Upgrade{ | ||
UpgradeName: UpgradeName, | ||
CreateUpgradeHandler: CreateUpgradeHandler, | ||
} |
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,33 @@ | ||
package v3 | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" | ||
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" | ||
"github.com/sge-network/sge/app/keepers" | ||
) | ||
|
||
func CreateUpgradeHandler( | ||
mm *module.Manager, | ||
configurator module.Configurator, | ||
keepers *keepers.AppKeepers, | ||
) upgradetypes.UpgradeHandler { | ||
return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { | ||
depositParams := keepers.GovKeeper.GetDepositParams(ctx) | ||
depositParams.MinExpeditedDeposit = sdk.NewCoins(sdk.NewCoin("usge", v1.DefaultMinExpeditedDepositTokens)) | ||
keepers.GovKeeper.SetDepositParams(ctx, depositParams) | ||
|
||
tallyParams := keepers.GovKeeper.GetTallyParams(ctx) | ||
tallyParams.ExpeditedThreshold = v1.DefaultExpeditedThreshold.String() | ||
tallyParams.ExpeditedQuorum = v1.DefaultExpeditedQuorum.String() | ||
keepers.GovKeeper.SetTallyParams(ctx, tallyParams) | ||
|
||
votingParams := keepers.GovKeeper.GetVotingParams(ctx) | ||
expeditedPeriod := v1.DefaultExpeditedPeriod | ||
votingParams.ExpeditedVotingPeriod = &expeditedPeriod | ||
keepers.GovKeeper.SetVotingParams(ctx, votingParams) | ||
|
||
return mm.RunMigrations(ctx, configurator, fromVM) | ||
} | ||
} |
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