Skip to content

Commit

Permalink
refactor: simplify group dependency graph and align 0.52 and main (#2…
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt authored Dec 18, 2024
1 parent cb56c6e commit 4d6c991
Show file tree
Hide file tree
Showing 19 changed files with 170 additions and 196 deletions.
1 change: 0 additions & 1 deletion tests/integration/v2/gov/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,5 +203,4 @@ func (s *suite) registerMsgRouterService(router *integration.RouterService) {
}

func (f *suite) registerQueryRouterService(router *integration.RouterService) {

}
1 change: 0 additions & 1 deletion tests/integration/v2/gov/keeper/fixture_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,4 @@ func (f *fixture) registerMsgRouterService(router *integration.RouterService) {
}

func (f *fixture) registerQueryRouterService(router *integration.RouterService) {

}
3 changes: 1 addition & 2 deletions tests/integration/v2/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ var (
_ event.Manager = &eventManager{}
)

type eventService struct {
}
type eventService struct{}

// EventManager implements event.Service.
func (e *eventService) EventManager(ctx context.Context) event.Manager {
Expand Down
1 change: 0 additions & 1 deletion x/accounts/defaults/lockup/lockup.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,6 @@ func (bva *BaseLockup) checkUnbondingEntriesMature(ctx context.Context) error {
if !errorsmod.IsOf(err, stakingtypes.ErrNoUnbondingDelegation) {
return true, err
}

}

found := false
Expand Down
1 change: 0 additions & 1 deletion x/accounts/defaults/lockup/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ func newMockContext(t *testing.T) (context.Context, store.KVStoreService) {
default:
return nil, errors.New("unrecognized request type")
}

},
)
}
Expand Down
13 changes: 10 additions & 3 deletions x/bank/testutil/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,26 @@ package testutil
import (
"context"

bankkeeper "cosmossdk.io/x/bank/keeper"
"cosmossdk.io/x/bank/types"

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

// minimalBankKeeper is a subset of the bankkeeper.Keeper interface that is used
// for the bank testing utilities.
type minimalBankKeeper interface {
MintCoins(ctx context.Context, moduleName string, amt sdk.Coins) error
SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
SendCoinsFromModuleToModule(ctx context.Context, senderModule, recipientModule string, amt sdk.Coins) error
}

// FundAccount is a utility function that funds an account by minting and
// sending the coins to the address. This should be used for testing purposes
// only!
//
// TODO: Instead of using the mint module account, which has the
// permission of minting, create a "faucet" account. (@fdymylja)
func FundAccount(ctx context.Context, bankKeeper bankkeeper.Keeper, addr sdk.AccAddress, amounts sdk.Coins) error {
func FundAccount(ctx context.Context, bankKeeper minimalBankKeeper, addr sdk.AccAddress, amounts sdk.Coins) error {
if err := bankKeeper.MintCoins(ctx, types.MintModuleName, amounts); err != nil {
return err
}
Expand All @@ -29,7 +36,7 @@ func FundAccount(ctx context.Context, bankKeeper bankkeeper.Keeper, addr sdk.Acc
//
// TODO: Instead of using the mint module account, which has the
// permission of minting, create a "faucet" account. (@fdymylja)
func FundModuleAccount(ctx context.Context, bankKeeper bankkeeper.Keeper, recipientMod string, amounts sdk.Coins) error {
func FundModuleAccount(ctx context.Context, bankKeeper minimalBankKeeper, recipientMod string, amounts sdk.Coins) error {
if err := bankKeeper.MintCoins(ctx, types.MintModuleName, amounts); err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion x/distribution/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,5 @@ replace github.com/cosmos/cosmos-sdk => ../../.
// TODO remove post spinning out all modules
replace (
cosmossdk.io/x/bank => ../bank
cosmossdk.io/x/protocolpool => ../protocolpool
cosmossdk.io/x/staking => ../staking
)
12 changes: 1 addition & 11 deletions x/group/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,8 @@ require (
cosmossdk.io/log v1.5.0
cosmossdk.io/math v1.4.0
cosmossdk.io/store v1.10.0-rc.1
cosmossdk.io/x/accounts v0.0.0-20240913065641-0064ccbce64e
cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91
cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000
cosmossdk.io/x/gov v0.0.0-20231113122742-912390d5fc4a
cosmossdk.io/x/mint v0.0.0-00010101000000-000000000000
cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000
github.com/cockroachdb/apd/v3 v3.2.1
github.com/cosmos/cosmos-proto v1.0.0-beta.5
github.com/cosmos/cosmos-sdk v0.53.0
Expand All @@ -38,7 +34,7 @@ require (
buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.36.0-20240130113600-88ef6483f90f.1 // indirect
cosmossdk.io/collections v1.0.0-rc.1 // indirect
cosmossdk.io/schema v1.0.0 // indirect
cosmossdk.io/x/epochs v0.0.0-20240522060652-a1ae4c3e0337 // indirect
cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect
cosmossdk.io/x/tx v1.0.0-alpha.3 // indirect
filippo.io/edwards25519 v1.1.0 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
Expand Down Expand Up @@ -184,13 +180,7 @@ replace github.com/cosmos/cosmos-sdk => ../../
// TODO remove post spinning out all modules
replace (
cosmossdk.io/client/v2 => ../../client/v2
cosmossdk.io/x/accounts => ../accounts
cosmossdk.io/x/bank => ../bank
cosmossdk.io/x/consensus => ../consensus
cosmossdk.io/x/epochs => ../epochs
cosmossdk.io/x/gov => ../gov
cosmossdk.io/x/mint => ../mint
cosmossdk.io/x/protocolpool => ../protocolpool
cosmossdk.io/x/slashing => ../slashing
cosmossdk.io/x/staking => ../staking
)
2 changes: 2 additions & 0 deletions x/group/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ cosmossdk.io/schema v1.0.0 h1:/diH4XJjpV1JQwuIozwr+A4uFuuwanFdnw2kKeiXwwQ=
cosmossdk.io/schema v1.0.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ=
cosmossdk.io/store v1.10.0-rc.1 h1:/YVPJLre7lt/QDbl90k95TLt+IvafF1sHaU6WHd/rpc=
cosmossdk.io/store v1.10.0-rc.1/go.mod h1:eZNgZKvZRlDUk8CE3LTDVMAcSM7zLOet2S8fByQkF3s=
cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190 h1:XQJj9Dv9Gtze0l2TF79BU5lkP6MkUveTUuKICmxoz+o=
cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190/go.mod h1:7WUGupOvmlHJoIMBz1JbObQxeo6/TDiuDBxmtod8HRg=
cosmossdk.io/x/tx v1.0.0-alpha.3 h1:+55/JFH5QRqnFhOI2heH3DKsaNL0RpXcJOQNzUvHiaQ=
cosmossdk.io/x/tx v1.0.0-alpha.3/go.mod h1:h4pQ/j6Gfu8goB1R3Jbl4qY4RjYVNAsoylcleTXdSRg=
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
Expand Down
Loading

0 comments on commit 4d6c991

Please sign in to comment.