Deref program account

This commit is contained in:
Armani Ferrante 2021-02-01 08:21:00 -08:00
parent 056e33370b
commit eae05f2c3b
No known key found for this signature in database
GPG Key ID: D597A80BCF8E12B7
2 changed files with 1 additions and 7 deletions

View File

@ -104,7 +104,7 @@ pub mod multisig {
}
// Execute the multisig transaction.
let ix: Instruction = ctx.accounts.transaction.account().into();
let ix: Instruction = (&*ctx.accounts.transaction).into();
let seeds = &[
ctx.accounts.multisig.to_account_info().key.as_ref(),
&[ctx.accounts.multisig.nonce],

View File

@ -16,12 +16,6 @@ pub struct ProgramAccount<'info, T: AccountSerialize + AccountDeserialize + Clon
inner: Box<Inner<'info, T>>,
}
impl<'info, T: AccountSerialize + AccountDeserialize + Clone> ProgramAccount<'info, T> {
pub fn account(&self) -> &T {
&self.inner.account
}
}
#[derive(Clone)]
struct Inner<'info, T: AccountSerialize + AccountDeserialize + Clone> {
info: AccountInfo<'info>,