-
Notifications
You must be signed in to change notification settings - Fork 209
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 #788 from lavanet/CNS-590-delegator-integration-on…
…-staging Cns 590 delegator integration on staging
- Loading branch information
Showing
8 changed files
with
81 additions
and
18 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
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,35 @@ | ||
package keeper | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/lavanet/lava/utils" | ||
protocoltypes "github.com/lavanet/lava/x/protocol/types" | ||
"github.com/lavanet/lava/x/spec/types" | ||
) | ||
|
||
type Migrator struct { | ||
keeper Keeper | ||
} | ||
|
||
func NewMigrator(keeper Keeper) Migrator { | ||
return Migrator{keeper: keeper} | ||
} | ||
|
||
func (m Migrator) UpgradeProtocolVersionParams(ctx sdk.Context) { | ||
params := m.keeper.GetParams(ctx) | ||
params.Version = protocoltypes.DefaultGenesis().Params.Version | ||
m.keeper.SetParams(ctx, params) | ||
|
||
detailsMap := map[string]string{ | ||
"param": string(protocoltypes.KeyVersion), | ||
"value": params.Version.String(), | ||
} | ||
|
||
utils.LogLavaEvent(ctx, m.keeper.Logger(ctx), types.ParamChangeEventName, detailsMap, "Gov Proposal Accepted Param Changed") | ||
} | ||
|
||
// Migrate2to3 implements store migration from v2 to v3: | ||
func (m Migrator) Migrate2to3(ctx sdk.Context) error { | ||
m.UpgradeProtocolVersionParams(ctx) | ||
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
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