solana-labs / solana-program-library

A collection of Solana programs maintained by Solana Labs
https://solanalabs.com
Apache License 2.0
3.56k stars 2.08k forks source link

lending: Support closing obligation accounts #994

Open jstarry opened 3 years ago

jstarry commented 3 years ago

Problem

When obligations are fully repaid, a user has no way of reclaiming the SOL used to cover rent for the obligation account

Proposed Change

Add a CloseObligation instruction which allows closing obligations that are fully repaid

allanperlee commented 2 years ago

Hi jstarry,

Is the obligation account initialized in process_init_reserve?

jordaaash commented 2 years ago

It's initialized in process_init_obligation 🙂

allanperlee commented 2 years ago

Thanks, is that on line 671, within the obligation struct?

jordaaash commented 2 years ago

https://github.com/solana-labs/solana-program-library/blob/70973850d3105c6765b42a35d1a67b36d0684c9a/token-lending/program/src/processor.rs#L637

allanperlee commented 2 years ago

@jordansexton How do I pass the workflow tests by the way? Even after running cargo clippy, the PR failed.

jordaaash commented 2 years ago

Hmm, it looks like it needs to have master merged in and the conflicts resolved. If you can do that, I can then trigger them to run again.