-
Notifications
You must be signed in to change notification settings - Fork 2
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 #3 from rarimo/chains/mainnet-v1.0.7
Upgrade v1.0.7
- Loading branch information
Showing
6 changed files
with
87 additions
and
7 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
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
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 v4 | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/cosmos/cosmos-sdk/codec" | ||
storetypes "github.com/cosmos/cosmos-sdk/store/types" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/rarimo/rarimo-core/x/rarimocore/types" | ||
) | ||
|
||
func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.BinaryCodec) error { | ||
ctx.Logger().Info(fmt.Sprintf("Performing v0.0.7 %s module migrations", types.ModuleName)) | ||
|
||
params := types.Params{} | ||
b := ctx.KVStore(storeKey).Get(types.KeyPrefix(types.ParamsKey)) | ||
cdc.MustUnmarshal(b, ¶ms) | ||
|
||
// Fixing the issue with unexpected slashing 1 of 2 active partis due to | ||
// saving all violations without expiration. | ||
for _, party := range params.Parties { | ||
party.ViolationsCount = 0 | ||
party.ReportedSessions = []string{} | ||
party.Status = types.PartyStatus_Active | ||
party.FreezeEndBlock = 0 | ||
} | ||
|
||
params.IsUpdateRequired = false | ||
|
||
b = cdc.MustMarshal(¶ms) | ||
ctx.KVStore(storeKey).Set(types.KeyPrefix(types.ParamsKey), b) | ||
return nil | ||
} |
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