浏览代码

Deref program account

Armani Ferrante 4 年之前
父节点
当前提交
eae05f2c3b
共有 2 个文件被更改,包括 1 次插入7 次删除
  1. 1 1
      examples/multisig/programs/multisig/src/lib.rs
  2. 0 6
      lang/src/program_account.rs

+ 1 - 1
examples/multisig/programs/multisig/src/lib.rs

@@ -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],

+ 0 - 6
lang/src/program_account.rs

@@ -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>,