Skip to content

Commit

Permalink
Mint 150M rowan for 0.13.2
Browse files Browse the repository at this point in the history
  • Loading branch information
timlind committed May 5, 2022
1 parent 06cbc0b commit 3070d94
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
23 changes: 22 additions & 1 deletion app/setup_handlers.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,38 @@
package app

import (
clptypes "github.com/Sifchain/sifnode/x/clp/types"
dispensationtypes "github.com/Sifchain/sifnode/x/dispensation/types"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
m "github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/x/upgrade/types"
)

const releaseVersion = "0.13.2-rc.1"
const releaseVersion = "0.13.2"

func SetupHandlers(app *SifchainApp) {
app.UpgradeKeeper.SetUpgradeHandler(releaseVersion, func(ctx sdk.Context, plan types.Plan, vm m.VersionMap) (m.VersionMap, error) {
app.Logger().Info("Running upgrade handler for " + releaseVersion)
amt, ok := sdk.NewIntFromString("150000000000000000000000000")
if !ok {
panic("error converting mint amount")
}
mintCoins := sdk.NewCoins(sdk.NewCoin(clptypes.GetSettlementAsset().Symbol, amt))
err := app.BankKeeper.MintCoins(ctx, dispensationtypes.ModuleName, mintCoins)
if err != nil {
panic(err)
}
// TODO: get destination address
address, err := sdk.AccAddressFromBech32("")
if err != nil {
panic(err)
}
err = app.BankKeeper.SendCoinsFromModuleToAccount(ctx, dispensationtypes.ModuleName, address, mintCoins)
if err != nil {
panic(err)
}

return app.mm.RunMigrations(ctx, app.configurator, vm)
})

Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.13.2-rc.1
0.13.2

0 comments on commit 3070d94

Please sign in to comment.