diff --git a/x/market/keeper/msg_server_create_pool.go b/x/market/keeper/msg_server_create_pool.go index f3efeae..a3aef1a 100644 --- a/x/market/keeper/msg_server_create_pool.go +++ b/x/market/keeper/msg_server_create_pool.go @@ -55,12 +55,22 @@ func (k msgServer) CreatePool(goCtx context.Context, msg *types.MsgCreatePool) ( } } + // Get the borrower address + creator, _ := sdk.AccAddressFromBech32(msg.Creator) + + // All coins added to pools are deposited into the module account until redemption + sdkError := k.bankKeeper.SendCoinsFromAccountToModule(ctx, creator, types.ModuleName, coinPair) + if sdkError != nil { + return nil, sdkError + } + _ = member1 _ = member2 _ = pair _ = pool _ = found _ = ctx + _ = creator return &types.MsgCreatePoolResponse{}, nil } diff --git a/x/market/types/expected_keepers.go b/x/market/types/expected_keepers.go index 4a50d01..ec5922c 100644 --- a/x/market/types/expected_keepers.go +++ b/x/market/types/expected_keepers.go @@ -15,6 +15,7 @@ type AccountKeeper interface { // BankKeeper defines the expected interface for the Bank module. type BankKeeper interface { SpendableCoins(context.Context, sdk.AccAddress) sdk.Coins + SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error // Methods imported from bank should be defined here }