Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…onboarding-rs into chapter_3
  • Loading branch information
URANI committed Mar 27, 2024
2 parents 152a9d7 + a4c2be0 commit 561643c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions chapters/03_anchor.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ pub struct SetData<'info> {

* Constraints can be added through:

<br>

```rust
#[account(<constraints>)]
pub account: AccountType
Expand All @@ -142,6 +144,8 @@ pub account: AccountType

* You can use the `require` macro to simplify writing errors.

<br>

```rust
#[program]
mod hello_anchor {
Expand All @@ -162,6 +166,7 @@ pub enum MyError {

<br>


----

### Hello World
Expand Down Expand Up @@ -212,16 +217,11 @@ mod hello_anchor {
pub struct Initialize {}
```

* The way an endpoint is connected to its corresponding Accounts struct is the `ctx` argument in the endpoint.

* The argument is of type `Context` which is generic over an Account struct, i.e., this is where you put the name of your account validation struct (e.g. `Initalize`).


<br>

----
* The way an endpoint is connected to its corresponding Accounts struct is the `ctx` argument in the endpoint.

### Tests
* The argument is of type `Context` which is generic over an Account struct, i.e., this is where you put the name of your account validation struct (e.g. `Initalize`).


<br>
Expand Down

0 comments on commit 561643c

Please sign in to comment.