Skip to content

Commit

Permalink
Code format
Browse files Browse the repository at this point in the history
  • Loading branch information
Segfaultd committed Oct 19, 2023
1 parent 8daebb5 commit 3ce78ec
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 6 deletions.
1 change: 1 addition & 0 deletions x/beam/migrations/migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package migrations

import (
sdk "github.com/cosmos/cosmos-sdk/types"

v162 "github.com/lum-network/chain/x/beam/migrations/v162"

keeper2 "github.com/lum-network/chain/x/beam/keeper"
Expand Down
2 changes: 2 additions & 0 deletions x/beam/migrations/v162/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ package v162

import (
"fmt"

sdk "github.com/cosmos/cosmos-sdk/types"

beamkeeper "github.com/lum-network/chain/x/beam/keeper"
beamtypes "github.com/lum-network/chain/x/beam/types"
)
Expand Down
8 changes: 5 additions & 3 deletions x/beam/migrations/v162/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@ package v162_test

import (
"encoding/hex"
"testing"
"time"

tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/stretchr/testify/suite"

apptypes "github.com/lum-network/chain/app"
apptesting "github.com/lum-network/chain/app/testing"
"github.com/lum-network/chain/utils"
v162 "github.com/lum-network/chain/x/beam/migrations/v162"
"github.com/lum-network/chain/x/beam/types"
"github.com/stretchr/testify/suite"
"testing"
"time"
)

type StoreMigrationTestSuite struct {
Expand Down
1 change: 1 addition & 0 deletions x/dfract/migrations/migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package migrations

import (
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/lum-network/chain/x/dfract/keeper"
v162 "github.com/lum-network/chain/x/dfract/migrations/v162"
)
Expand Down
5 changes: 5 additions & 0 deletions x/dfract/migrations/v162/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ package v162

import (
sdk "github.com/cosmos/cosmos-sdk/types"

dfractkeeper "github.com/lum-network/chain/x/dfract/keeper"
dfracttypes "github.com/lum-network/chain/x/dfract/types"
)

func Nuke(ctx sdk.Context, dk dfractkeeper.Keeper) error {
// Destroy the queues
dk.IterateDepositsPendingMint(ctx, func(deposit dfracttypes.Deposit) bool {
dk.RemoveDepositPendingMint(ctx, sdk.MustAccAddressFromBech32(deposit.GetDepositorAddress()))
return false
Expand All @@ -15,6 +17,8 @@ func Nuke(ctx sdk.Context, dk dfractkeeper.Keeper) error {
dk.RemoveDepositPendingWithdrawal(ctx, sdk.MustAccAddressFromBech32(deposit.GetDepositorAddress()))
return false
})

// This one is a special case. To be able to burn coins, we need to move them to the module account first
dk.IterateDepositsMinted(ctx, func(deposit dfracttypes.Deposit) bool {
// Get the supply for the given depositor
supply := dk.BankKeeper.GetBalance(ctx, sdk.MustAccAddressFromBech32(deposit.GetDepositorAddress()), dfracttypes.MintDenom)
Expand All @@ -32,6 +36,7 @@ func Nuke(ctx sdk.Context, dk dfractkeeper.Keeper) error {
dk.RemoveDepositMinted(ctx, sdk.MustAccAddressFromBech32(deposit.GetDepositorAddress()))
return false
})

return nil
}

Expand Down
8 changes: 5 additions & 3 deletions x/dfract/migrations/v162/store_test.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
package v162_test

import (
"testing"
"time"

tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/stretchr/testify/suite"

apptypes "github.com/lum-network/chain/app"
apptesting "github.com/lum-network/chain/app/testing"
"github.com/lum-network/chain/x/dfract/keeper"
v162 "github.com/lum-network/chain/x/dfract/migrations/v162"
dfracttypes "github.com/lum-network/chain/x/dfract/types"
"github.com/stretchr/testify/suite"
"testing"
"time"
)

type StoreMigrationTestSuite struct {
Expand Down
1 change: 1 addition & 0 deletions x/dfract/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/lum-network/chain/x/dfract/migrations"

abci "github.com/cometbft/cometbft/abci/types"
Expand Down

0 comments on commit 3ce78ec

Please sign in to comment.