diff --git a/x/liquidstakeibc/keeper/msg_server.go b/x/liquidstakeibc/keeper/msg_server.go index 3019efe7..6376058e 100644 --- a/x/liquidstakeibc/keeper/msg_server.go +++ b/x/liquidstakeibc/keeper/msg_server.go @@ -376,6 +376,14 @@ func (k msgServer) UpdateHostChain( if err != nil { return nil, err } + case types.KeyForceTransferDeposits: + amount := k.bankKeeper.GetBalance(ctx, k.GetDepositModuleAccount(ctx).GetAddress(), hc.IBCDenom()) + if amount.IsPositive() { + err := k.bankKeeper.SendCoins(ctx, k.GetDepositModuleAccount(ctx).GetAddress(), k.GetUndelegationModuleAccount(ctx).GetAddress(), sdktypes.NewCoins(amount)) + if err != nil { + return nil, err + } + } default: return nil, fmt.Errorf("invalid or unexpected update key: %s", update.Key) } diff --git a/x/liquidstakeibc/types/keys.go b/x/liquidstakeibc/types/keys.go index d1dde07a..aa898286 100644 --- a/x/liquidstakeibc/types/keys.go +++ b/x/liquidstakeibc/types/keys.go @@ -90,6 +90,7 @@ const ( KeyForceUnbond string = "force_unbond" KeyForceICATransfer string = "force_ica_transfer" KeyForceICATransferRewards string = "force_ica_transfer_rewards" + KeyForceTransferDeposits string = "force_transfer_deposits" ) var ( diff --git a/x/liquidstakeibc/types/msgs.go b/x/liquidstakeibc/types/msgs.go index a4dd4582..e9b6133c 100644 --- a/x/liquidstakeibc/types/msgs.go +++ b/x/liquidstakeibc/types/msgs.go @@ -422,6 +422,11 @@ func (m *MsgUpdateHostChain) ValidateBasic() error { if err != nil { return err } + case KeyForceTransferDeposits: + // expected nothing, "" + if update.Value != "" { + return fmt.Errorf("invalid force transfer deposits, expected \"\" ") + } default: return fmt.Errorf("invalid or unexpected update key: %s", update.Key) }