Skip to content

Commit

Permalink
sdk50 upgrade test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
antstalepresh committed Jul 21, 2024
1 parent 641e06c commit badf855
Show file tree
Hide file tree
Showing 6 changed files with 285 additions and 56 deletions.
15 changes: 14 additions & 1 deletion app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

storetypes "cosmossdk.io/store/types"
upgradetypes "cosmossdk.io/x/upgrade/types"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
"github.com/cosmos/cosmos-sdk/types/module"
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
icacontrollertypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types"
Expand Down Expand Up @@ -65,9 +66,21 @@ func (app App) RegisterUpgradeHandlers() {
app.UpgradeKeeper.SetUpgradeHandler(
UpgradeName,
func(ctx context.Context,
_ upgradetypes.Plan,
plan upgradetypes.Plan,
fromVM module.VersionMap,
) (module.VersionMap, error) {
params, err := app.ConsensusParamsKeeper.ParamsStore.Get(ctx)
if err != nil {
return fromVM, err
}
params.Abci = &tmproto.ABCIParams{
VoteExtensionsEnableHeight: plan.Height + 1,
}
err = app.ConsensusParamsKeeper.ParamsStore.Set(ctx, params)
if err != nil {
return fromVM, err
}

return app.ModuleManager.RunMigrations(ctx, app.Configurator(), fromVM)
},
)
Expand Down
9 changes: 9 additions & 0 deletions proto/kujira/oracle/oracle.proto
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ message Params {
];
}

// Denom - the object to hold configurations of each denom
message Denom {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;

string name = 1 [(gogoproto.moretags) = "yaml:\"name\""];
}

// Symbol - the object to hold configurations of each symbol
message Symbol {
option (gogoproto.equal) = false;
Expand Down
2 changes: 1 addition & 1 deletion x/oracle/migrations/v1/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func MigrateParams(
for id, denom := range whitelist {
symbols = append(symbols, oracletypes.Symbol{
Id: uint32(id + 1),
Symbol: denom.Symbol,
Symbol: denom.Name,
})
}

Expand Down
20 changes: 13 additions & 7 deletions x/oracle/types/legacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,13 @@ import (
)

// String implements fmt.Stringer interface
func (d Symbol) String() string {
func (d Denom) String() string {
out, _ := yaml.Marshal(d)
return string(out)
}

// Equal implements equal interface
func (d Symbol) Equal(d1 *Symbol) bool {
return d.Symbol == d1.Symbol
}

// DenomList is array of Denom
type DenomList []Symbol
type DenomList []Denom

// String implements fmt.Stringer interface
func (dl DenomList) String() (out string) {
Expand All @@ -27,3 +22,14 @@ func (dl DenomList) String() (out string) {
}
return strings.TrimSpace(out)
}

// String implements fmt.Stringer interface
func (d Symbol) String() string {
out, _ := yaml.Marshal(d)
return string(out)
}

// Equal implements equal interface
func (d Symbol) Equal(d1 *Symbol) bool {
return d.Symbol == d1.Symbol
}
Loading

0 comments on commit badf855

Please sign in to comment.