Skip to content

Commit

Permalink
fix import cycle
Browse files Browse the repository at this point in the history
Signed-off-by: Shrenuj Bansal <[email protected]>
  • Loading branch information
shrenujb committed Nov 26, 2024
1 parent 77bab93 commit 5162057
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
9 changes: 2 additions & 7 deletions protocol/app/upgrades/v8.0/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,13 @@ package v_8_0
import (
store "cosmossdk.io/store/types"
"github.com/dydxprotocol/v4-chain/protocol/app/upgrades"
affiliatetypes "github.com/dydxprotocol/v4-chain/protocol/x/affiliates/types"
)

const (
UpgradeName = "v8.0"
)

var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
StoreUpgrades: store.StoreUpgrades{
Added: []string{
affiliatetypes.StoreKey,
},
},
UpgradeName: UpgradeName,
StoreUpgrades: store.StoreUpgrades{},
}
6 changes: 4 additions & 2 deletions protocol/app/upgrades/v8.0/migrate_accountplus_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package v_8_0
package v_8_0_test

import (
"testing"

v_8_0 "github.com/dydxprotocol/v4-chain/protocol/app/upgrades/v8.0"

"cosmossdk.io/store/prefix"
sdk "github.com/cosmos/cosmos-sdk/types"
testapp "github.com/dydxprotocol/v4-chain/protocol/testutil/app"
Expand Down Expand Up @@ -54,7 +56,7 @@ func (s *UpgradeTestSuite) TestUpgrade_MigrateAccountplusAccountState() {
}

// Migrate
migrateAccountplusAccountState(ctx, s.tApp.App.AccountPlusKeeper)
v_8_0.MigrateAccountplusAccountState(ctx, s.tApp.App.AccountPlusKeeper)

// Verify that unprefixed keys are deleted and prefixed keys exist
for _, addr := range addresses {
Expand Down
2 changes: 1 addition & 1 deletion protocol/app/upgrades/v8.0/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
)

// Migrate accountplus AccountState in kvstore from non-prefixed keys to prefixed keys
func migrateAccountplusAccountState(ctx sdk.Context, k accountpluskeeper.Keeper) {
func MigrateAccountplusAccountState(ctx sdk.Context, k accountpluskeeper.Keeper) {
ctx.Logger().Info("Migrating accountplus module AccountState in kvstore from non-prefixed keys to prefixed keys")

store := ctx.KVStore(k.GetStoreKey())
Expand Down
3 changes: 2 additions & 1 deletion protocol/app/upgrades/v8.0/upgrade_container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package v_8_0_test
import (
"testing"

v_8_0 "github.com/dydxprotocol/v4-chain/protocol/app/upgrades/v8.0"

"github.com/cosmos/gogoproto/proto"

v_8_0 "github.com/dydxprotocol/v4-chain/protocol/app/upgrades/v8.0"
clobtypes "github.com/dydxprotocol/v4-chain/protocol/x/clob/types"

perptypes "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types"
Expand Down

0 comments on commit 5162057

Please sign in to comment.