Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AccountsClose Support for Boxed Accounts #856

Merged
merged 1 commit into from Oct 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion lang/src/boxed.rs
@@ -1,4 +1,4 @@
use crate::{Accounts, AccountsExit, ToAccountInfos, ToAccountMetas};
use crate::{Accounts, AccountsClose, AccountsExit, ToAccountInfos, ToAccountMetas};
use solana_program::account_info::AccountInfo;
use solana_program::entrypoint::ProgramResult;
use solana_program::instruction::AccountMeta;
Expand Down Expand Up @@ -33,3 +33,9 @@ impl<T: ToAccountMetas> ToAccountMetas for Box<T> {
T::to_account_metas(self, is_signer)
}
}

impl<'info, T: AccountsClose<'info>> AccountsClose<'info> for Box<T> {
fn close(&self, sol_destination: AccountInfo<'info>) -> ProgramResult {
T::close(self, sol_destination)
}
}