Skip to content

Commit

Permalink
remove alliance
Browse files Browse the repository at this point in the history
  • Loading branch information
hoank101 committed Apr 28, 2024
1 parent 4b6e1e5 commit 04b6463
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 32 deletions.
7 changes: 0 additions & 7 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services"
authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec"
alliancemodule "github.com/terra-money/alliance/x/alliance"
alliancemoduletypes "github.com/terra-money/alliance/x/alliance/types"
"io"
"os"
"path/filepath"
Expand Down Expand Up @@ -213,7 +211,6 @@ var (
ibctransfermiddleware.AppModuleBasic{},
circuit.AppModuleBasic{},
wasm08.AppModuleBasic{},
alliancemodule.AppModuleBasic{},
// this line is used by starport scaffolding # stargate/app/moduleBasic
)

Expand Down Expand Up @@ -397,7 +394,6 @@ func NewComposableApp(
icaModule,
ratelimitModule,
circuit.NewAppModule(appCodec, app.CircuitKeeper),
alliancemodule.NewAppModule(appCodec, app.AllianceKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry, app.GetSubspace(alliancemoduletypes.ModuleName)),
// this line is used by starport scaffolding # stargate/app/appModule
)

Expand Down Expand Up @@ -446,7 +442,6 @@ func NewComposableApp(
stakingmiddlewaretypes.ModuleName,
ibctransfermiddlewaretypes.ModuleName,
wasm08types.ModuleName,
alliancemoduletypes.ModuleName,
// this line is used by starport scaffolding # stargate/app/beginBlockers
)

Expand Down Expand Up @@ -483,7 +478,6 @@ func NewComposableApp(
stakingmiddlewaretypes.ModuleName,
ibctransfermiddlewaretypes.ModuleName,
wasm08types.ModuleName,
alliancemoduletypes.ModuleName,
)

// NOTE: The genutils module must occur after staking so that pools are
Expand Down Expand Up @@ -524,7 +518,6 @@ func NewComposableApp(
stakingmiddlewaretypes.ModuleName,
ibctransfermiddlewaretypes.ModuleName,
wasm08types.ModuleName,
alliancemoduletypes.ModuleName,
// this line is used by starport scaffolding # stargate/app/initGenesis
)

Expand Down
16 changes: 2 additions & 14 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package keepers
import (
"fmt"
alliancemodulekeeper "github.com/terra-money/alliance/x/alliance/keeper"
alliancemoduletypes "github.com/terra-money/alliance/x/alliance/types"
"math"
"path/filepath"
"strings"
Expand Down Expand Up @@ -281,21 +280,11 @@ func (appKeepers *AppKeepers) InitNormalKeepers(
appKeepers.FeeGrantKeeper = feegrantkeeper.NewKeeper(appCodec, runtime.NewKVStoreService(appKeepers.keys[feegrant.StoreKey]), appKeepers.AccountKeeper)
appKeepers.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, runtime.NewKVStoreService(appKeepers.keys[upgradetypes.StoreKey]), appCodec, homePath, bApp, govModAddress)

appKeepers.AllianceKeeper = alliancemodulekeeper.NewKeeper(
appCodec,
runtime.NewKVStoreService(appKeepers.keys[alliancemoduletypes.StoreKey]),
appKeepers.AccountKeeper,
appKeepers.BankKeeper,
appKeepers.StakingKeeper,
appKeepers.DistrKeeper,
authtypes.FeeCollectorName,
govModAddress,
)
appKeepers.BankKeeper.RegisterKeepers(appKeepers.AllianceKeeper, appKeepers.StakingKeeper)
appKeepers.BankKeeper.RegisterKeepers(appKeepers.AccountKeeper, appKeepers.StakingKeeper)
// register the staking hooks
// NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks
appKeepers.StakingKeeper.SetHooks(
stakingtypes.NewMultiStakingHooks(appKeepers.DistrKeeper.Hooks(), appKeepers.SlashingKeeper.Hooks(), appKeepers.AllianceKeeper.StakingHooks()),
stakingtypes.NewMultiStakingHooks(appKeepers.DistrKeeper.Hooks(), appKeepers.SlashingKeeper.Hooks()),
)

// ... other modules keepers
Expand Down Expand Up @@ -602,7 +591,6 @@ func (appKeepers *AppKeepers) initParamsKeeper(appCodec codec.BinaryCodec, legac
paramsKeeper.Subspace(transfermiddlewaretypes.ModuleName).WithKeyTable(transfermiddlewaretypes.ParamKeyTable())
paramsKeeper.Subspace(stakingmiddlewaretypes.ModuleName)
paramsKeeper.Subspace(ibctransfermiddlewaretypes.ModuleName)
paramsKeeper.Subspace(alliancemoduletypes.ModuleName).WithKeyTable(alliancemoduletypes.ParamKeyTable())

return paramsKeeper
}
Expand Down
3 changes: 0 additions & 3 deletions app/keepers/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import (
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper"
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
alliancemoduletypes "github.com/terra-money/alliance/x/alliance/types"

// bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"

evidencetypes "cosmossdk.io/x/evidence/types"
Expand Down Expand Up @@ -66,7 +64,6 @@ func (appKeepers *AppKeepers) GenerateKeys() {
ibcexported.StoreKey,
ibchookstypes.StoreKey, icahosttypes.StoreKey,
ratelimitmoduletypes.StoreKey, txBoundaryTypes.StoreKey,
alliancemoduletypes.StoreKey,
)

// Define transient store keys
Expand Down
10 changes: 4 additions & 6 deletions custom/bank/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ import (
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
accountkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
banktypes "github.com/notional-labs/composable/v6/custom/bank/types"
alliancekeeper "github.com/terra-money/alliance/x/alliance/keeper"

bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
"github.com/cosmos/cosmos-sdk/x/bank/types"
banktypes "github.com/notional-labs/composable/v6/custom/bank/types"

Check failure on line 12 in custom/bank/keeper/keeper.go

View workflow job for this annotation

GitHub Actions / lint

could not import github.com/notional-labs/composable/v6/custom/bank/types (-: cannot compile Go 1.22 code) (typecheck)
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

Expand All @@ -22,7 +20,7 @@ type Keeper struct {
bankkeeper.BaseKeeper
tfmk banktypes.TransferMiddlewareKeeper
sk banktypes.StakingKeeper
ak alliancekeeper.Keeper
ak accountkeeper.AccountKeeper
}

var _ bankkeeper.Keeper = Keeper{}
Expand All @@ -39,12 +37,12 @@ func NewBaseKeeper(
keeper := Keeper{
BaseKeeper: bankkeeper.NewBaseKeeper(cdc, storeService, ak, blockedAddrs, authority, logger),
tfmk: tfmk,
ak: alliancekeeper.Keeper{},
ak: ak,
}
return keeper
}

func (k *Keeper) RegisterKeepers(ak alliancekeeper.Keeper, sk banktypes.StakingKeeper) {
func (k *Keeper) RegisterKeepers(ak accountkeeper.AccountKeeper, sk banktypes.StakingKeeper) {
k.ak = ak
k.sk = sk
}
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ require (
github.com/spf13/cast v1.6.0
github.com/spf13/cobra v1.8.0
github.com/stretchr/testify v1.9.0
github.com/terra-money/alliance v0.4.3
golang.org/x/tools v0.18.0
google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c
google.golang.org/grpc v1.62.1
gotest.tools/v3 v3.5.1
mvdan.cc/gofumpt v0.4.0
github.com/terra-money/alliance v0.4.3
)

require github.com/cometbft/cometbft-db v0.11.0 // indirect
Expand Down Expand Up @@ -115,7 +115,7 @@ require (
github.com/gostaticanalysis/nilerr v0.1.1 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-hclog v1.6.2 // indirect
github.com/hashicorp/go-metrics v0.5.3 // indirect
github.com/hashicorp/go-metrics v0.5.3
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-plugin v1.6.0 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
Expand Down

0 comments on commit 04b6463

Please sign in to comment.