lang: Add Box<T> implementation for the AccountsClose trait (#856)

This commit is contained in:
Matthew Callens 2021-10-09 17:11:47 -04:00 committed by GitHub
parent d774b456bf
commit 39576de39c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -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;
@ -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)
}
}