Skip to content

Commit

Permalink
Add Emission Enabled bolean flag to Mint Module (#708)
Browse files Browse the repository at this point in the history
## Purpose of Changes and their Description

This change adds a mint module parameter that allows network
administrators or the `/x/gov` governance module to control whether or
not any new tokens are minted, basically entirely turning off paying for
rewards and creating new tokens / inflation.

## Link(s) to Ticket(s) or Issue(s) resolved by this PR

PROTO-3083

## Are these changes tested and documented?

New tests added to `x/mint/migrations/v5/migrate_test.go` and
`x/mint/module/module_test.go`
  • Loading branch information
kpeluso authored Dec 17, 2024
2 parents 7520daa + 8fa5528 commit 73c4bbe
Show file tree
Hide file tree
Showing 17 changed files with 3,713 additions and 78 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

* [#694](https://github.com/allora-network/allora-chain/pull/694) Make fuzzer whitelist aware
* [#708](https://github.com/allora-network/allora-chain/pull/708) Add Emission Enabled bolean flag to Mint Module

### Fixed

Expand Down
2 changes: 2 additions & 0 deletions app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/allora-network/allora-chain/app/upgrades/v0_5_0"
"github.com/allora-network/allora-chain/app/upgrades/v0_6_0"
"github.com/allora-network/allora-chain/app/upgrades/v0_7_0"
"github.com/allora-network/allora-chain/app/upgrades/v0_8_0"
)

var upgradeHandlers = []upgrades.Upgrade{
Expand All @@ -19,6 +20,7 @@ var upgradeHandlers = []upgrades.Upgrade{
v0_5_0.Upgrade,
v0_6_0.Upgrade,
v0_7_0.Upgrade,
v0_8_0.Upgrade,
// Add more upgrade handlers here
// ...
}
Expand Down
31 changes: 31 additions & 0 deletions app/upgrades/v0_8_0/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package v0_8_0 //nolint:revive // var-naming: don't use an underscore in package name

import (
"context"

storetypes "cosmossdk.io/store/types"
upgradetypes "cosmossdk.io/x/upgrade/types"
"github.com/allora-network/allora-chain/app/keepers"
"github.com/allora-network/allora-chain/app/upgrades"
"github.com/cosmos/cosmos-sdk/types/module"
)

const (
UpgradeName = "v0.8.0"
)

var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
CreateUpgradeHandler: CreateUpgradeHandler,
StoreUpgrades: storetypes.StoreUpgrades{Added: nil, Renamed: nil, Deleted: nil},
}

func CreateUpgradeHandler(
moduleManager *module.Manager,
configurator module.Configurator,
keepers *keepers.AppKeepers,
) upgradetypes.UpgradeHandler {
return func(ctx context.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
return moduleManager.RunMigrations(ctx, configurator, vm)
}
}
Loading

0 comments on commit 73c4bbe

Please sign in to comment.