Browse Source

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

Camden Clark 4 years ago
parent
commit
1ba6db0afe
1 changed files with 4 additions and 2 deletions
  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.
 - `mut`: tells the program to persist all changes to the account.
 - `has_one`: enforces the constraint that `Increment.counter.authority == Increment.authority.key`.
 - `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.
 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
 This allows us to completely separate account validation from our program's business logic, allowing us