diff --git a/src/anchor_bts/discriminator.md b/src/anchor_bts/discriminator.md index 1b149b5..c1a7f51 100644 --- a/src/anchor_bts/discriminator.md +++ b/src/anchor_bts/discriminator.md @@ -109,7 +109,7 @@ However, a user mistakenly passes Account B as an argument to the `foo` instruct This is where the discriminator comes into play. It uniquely identifies the type of an account. Even though Account A and Account B are structurally identical and share the same owner, they have different discriminators. -When the `foo` instruction gets executed, the Anchor framework checks the discriminator of the account passed as argument. If you have declared `foo` as `foo: Account<'info, A>`, Anchor will make sure that the passed account's discriminator matches that of Account A. If the discriminators don't match (as would be the case if Account B was passed), Anchor raises an error, preventing any unintended effects on Account B. +When the `foo` instruction gets executed, the Anchor framework checks the discriminator of the account passed as an argument. If you have declared `foo` as `foo: Account<'info, A>`, Anchor will make sure that the passed account's discriminator matches that of Account A. If the discriminators don't match (as would be the case if Account B was passed), Anchor raises an error, preventing any unintended effects on Account B. The discriminator helps Anchor to ensure that the account being processed is indeed the one expected, preventing type-related errors at runtime. This mechanism is automatically handled when you use the `Account` type in Anchor, adding an extra layer of security to your program. diff --git a/src/anchor_in_depth/anchor_programs_in-depth.md b/src/anchor_in_depth/anchor_programs_in-depth.md index bc771e1..48f00c9 100644 --- a/src/anchor_in_depth/anchor_programs_in-depth.md +++ b/src/anchor_in_depth/anchor_programs_in-depth.md @@ -4,4 +4,4 @@ This section explains how you can use Anchor to build Solana programs. Each sect anchor init hello-anchor ``` -This sections begins with the essentials and then explains more intermediate content afterwards. +This section begins with the essentials and then explains more intermediate content afterwards. diff --git a/src/anchor_in_depth/the_accounts_struct.md b/src/anchor_in_depth/the_accounts_struct.md index e5c5977..17eee5e 100644 --- a/src/anchor_in_depth/the_accounts_struct.md +++ b/src/anchor_in_depth/the_accounts_struct.md @@ -133,7 +133,7 @@ You can find information about all constraints in the reference. We will cover s ## Safety checks -Two of the Anchor account types, [AccountInfo](https://docs.rs/anchor-lang/latest/anchor_lang/accounts/account_info/index.html) and [UncheckedAccount](https://docs.rs/anchor-lang/latest/anchor_lang/accounts/unchecked_account/index.html) do not implement any checks on the account being passed. Anchor implements safety checks that encourage additional documentation describing why additional checks are not necesssary. +Two of the Anchor account types, [AccountInfo](https://docs.rs/anchor-lang/latest/anchor_lang/accounts/account_info/index.html) and [UncheckedAccount](https://docs.rs/anchor-lang/latest/anchor_lang/accounts/unchecked_account/index.html) do not implement any checks on the account being passed. Anchor implements safety checks that encourage additional documentation describing why additional checks are not necessary. Attempting to build a program containing the following excerpt with `anchor build`: @@ -164,4 +164,4 @@ pub struct Initialize<'info> { } ``` -Note the doc comment needs to be a [line or block doc comment](https://doc.rust-lang.org/reference/comments.html#doc-comments) (/// or /\*\*) to be interepreted as doc attribute by Rust. Double slash comments (//) are not interpreted as such. +Note the doc comment needs to be a [line or block doc comment](https://doc.rust-lang.org/reference/comments.html#doc-comments) (/// or /\*\*) to be interpreted as doc attribute by Rust. Double slash comments (//) are not interpreted as such.