Переглянути джерело

examples/misc: Mark associated account payer mut

armaniferrante 4 роки тому
батько
коміт
318eb520d4
1 змінених файлів з 3 додано та 3 видалено
  1. 3 3
      examples/misc/programs/misc/src/lib.rs

+ 3 - 3
examples/misc/programs/misc/src/lib.rs

@@ -88,8 +88,8 @@ pub struct TestStateCpi<'info> {
 }
 
 // `my_account` is the associated token account being created.
-// `authority` must be a signer since it will pay for the creation of the
-// associated token account. `state` is used as an association, i.e., one
+// `authority` must be a `mut` and `signer` since it will pay for the creation
+// of the associated token account. `state` is used as an association, i.e., one
 // can *optionally* identify targets to be used as seeds for the program
 // derived address by using `with` (and it doesn't have to be a state account).
 // For example, the SPL token program uses a `Mint` account. Lastly,
@@ -100,7 +100,7 @@ pub struct TestStateCpi<'info> {
 pub struct TestAssociatedAccount<'info> {
     #[account(associated = authority, with = state)]
     my_account: ProgramAccount<'info, TestData>,
-    #[account(signer)]
+    #[account(mut, signer)]
     authority: AccountInfo<'info>,
     state: ProgramState<'info, MyState>,
     rent: Sysvar<'info, Rent>,