Skip to content

Commit

Permalink
chore: run linter
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherbrumm committed Jan 31, 2025
1 parent 992f9c1 commit 9f7c920
Show file tree
Hide file tree
Showing 10 changed files with 5,891 additions and 11 deletions.
1 change: 1 addition & 0 deletions app/upgrades/v2_0/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package v2_0
import (
"context"
"fmt"

bundleskeeper "github.com/KYVENetwork/chain/x/bundles/keeper"

"github.com/KYVENetwork/chain/x/stakers/types"
Expand Down
1 change: 1 addition & 0 deletions x/bundles/keeper/getters_migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package keeper
import (
"encoding/binary"
"errors"

"github.com/KYVENetwork/chain/x/bundles/types"
"github.com/cosmos/cosmos-sdk/runtime"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down
4 changes: 3 additions & 1 deletion x/bundles/keeper/keeper.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package keeper

import (
"fmt"

"cosmossdk.io/collections"
"cosmossdk.io/core/store"
"cosmossdk.io/log"
storetypes "cosmossdk.io/store/types"
"fmt"

"github.com/KYVENetwork/chain/util"
"github.com/KYVENetwork/chain/x/bundles/types"
"github.com/cosmos/cosmos-sdk/codec"
Expand Down
19 changes: 9 additions & 10 deletions x/bundles/migration/migration.go
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
package migration

import (
"cosmossdk.io/log"
"cosmossdk.io/store/prefix"
storeTypes "cosmossdk.io/store/types"
"embed"
_ "embed"
"encoding/hex"
"fmt"
"strconv"
"strings"

"cosmossdk.io/log"
"cosmossdk.io/store/prefix"
"github.com/KYVENetwork/chain/util"
bundleskeeper "github.com/KYVENetwork/chain/x/bundles/keeper"
"github.com/KYVENetwork/chain/x/bundles/types"
"github.com/cosmos/cosmos-sdk/runtime"
sdk "github.com/cosmos/cosmos-sdk/types"
"strconv"
"strings"
)

var logger log.Logger

const (
BundlesMigrationStepSizePerPool uint64 = 100
WaitingBlockPeriod = 1
WaitingBlockPeriod int64 = 1
)

//go:embed files/*
Expand Down Expand Up @@ -71,8 +71,8 @@ func MigrateBundlesModule(sdkCtx sdk.Context, bundlesKeeper bundleskeeper.Keeper
}

for _, bundlesMigrationEntry := range bundlesMigration {
step := uint64(sdkCtx.BlockHeight()-upgradeHeight) - WaitingBlockPeriod
offset := step * BundlesMigrationStepSizePerPool
step := sdkCtx.BlockHeight() - upgradeHeight - WaitingBlockPeriod
offset := uint64(step) * BundlesMigrationStepSizePerPool

// Skip if all bundles have already been migrated
if offset > bundlesMigrationEntry.maxBundleId+BundlesMigrationStepSizePerPool {
Expand All @@ -91,8 +91,7 @@ func migrateFinalizedBundles(ctx sdk.Context, bundlesKeeper bundleskeeper.Keeper
storeAdapter := runtime.KVStoreAdapter(bundlesKeeper.Migration_GetStoreService().OpenKVStore(ctx))
store := prefix.NewStore(storeAdapter, util.GetByteKey(types.FinalizedBundlePrefix, bundlesMigrationEntry.poolId))

var iterator storeTypes.Iterator
iterator = store.Iterator(util.GetByteKey(offset), util.GetByteKey(offset+BundlesMigrationStepSizePerPool))
iterator := store.Iterator(util.GetByteKey(offset), util.GetByteKey(offset+BundlesMigrationStepSizePerPool))

var migratedBundles []types.FinalizedBundle

Expand Down
1 change: 1 addition & 0 deletions x/bundles/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"fmt"

"github.com/KYVENetwork/chain/x/bundles/migration"

"cosmossdk.io/core/appmodule"
Expand Down
Loading

0 comments on commit 9f7c920

Please sign in to comment.