Ver Fonte

docs: Update tutorial 2 with Signer changes (#917)

Camden Clark há 4 anos atrás
pai
commit
1ba6db0afe
1 ficheiros alterados com 4 adições e 2 exclusões
  1. 4 2
      docs/src/tutorials/tutorial-2.md

+ 4 - 2
docs/src/tutorials/tutorial-2.md

@@ -52,11 +52,13 @@ pub struct Increment<'info> {
 }
 ```
 
-Here, several `#[account(..)]` attributes are used.
+Here, a couple `#[account(..)]` attributes are used.
 
 - `mut`: tells the program to persist all changes to the account.
 - `has_one`: enforces the constraint that `Increment.counter.authority == Increment.authority.key`.
-- `signer`: enforces the constraint that the `authority` account **signed** the transaction.
+
+Another new concept here is the `Signer` type. This enforces the constraint that the `authority`
+account **signed** the transaction. However, anchor doesn't fetch the data on that account.
 
 If any of these constraints do not hold, then the `increment` instruction will never be executed.
 This allows us to completely separate account validation from our program's business logic, allowing us