Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
urani-engineering-helper authored Mar 27, 2024
1 parent 17216af commit a4c2be0
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 writting 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 a4c2be0

Please sign in to comment.