From b111ea271a2df238f50ef716084254af971064dc Mon Sep 17 00:00:00 2001 From: Sohrab <4444588+sohrab-@users.noreply.github.com> Date: Wed, 20 Apr 2022 23:10:47 +1000 Subject: [PATCH] fix: align to new folder structure (#72) --- src/anchor_in_depth/milestone_project_tic-tac-toe.md | 2 +- src/anchor_in_depth/the_accounts_struct.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/anchor_in_depth/milestone_project_tic-tac-toe.md b/src/anchor_in_depth/milestone_project_tic-tac-toe.md index 90fafe5..3f10b68 100644 --- a/src/anchor_in_depth/milestone_project_tic-tac-toe.md +++ b/src/anchor_in_depth/milestone_project_tic-tac-toe.md @@ -249,7 +249,7 @@ Let us briefly explain how we arrived at the `Game::MAXIMUM_SIZE`. Anchor uses t In addition to the game's size, we have to add another 8 to the space. This is space for the internal discriminator which anchor sets automatically. In short, the discriminator is how anchor can differentiate between different accounts of the same program. For more information, check out the Anchor space reference. -> [Anchor Space Reference](./../chapter_5/space.md) +> [Anchor Space Reference](./../anchor_references/space.md) > (What about using `mem::size_of()`? This almost works but not quite. The issue is that borsh will always serialize an option as 1 byte for the variant identifier and then additional x bytes for the content if it's Some. Rust uses null-pointer optimization to make Option's variant identifier 0 bytes when it can, so an option is sometimes just as big as its contents. This is the case with `Sign`. This means the `MAXIMUM_SIZE` could also be expressed as `mem::size_of() + 9`.) diff --git a/src/anchor_in_depth/the_accounts_struct.md b/src/anchor_in_depth/the_accounts_struct.md index 36be18d..e5c5977 100644 --- a/src/anchor_in_depth/the_accounts_struct.md +++ b/src/anchor_in_depth/the_accounts_struct.md @@ -151,7 +151,7 @@ Error: /anchor/tests/unchecked/programs/unchecked/src/lib.rs:15:8 Struct field "potentially_dangerous" is unsafe, but is not documented. Please add a `/// CHECK:` doc comment explaining why no checks through types are necessary. - See https://book.anchor-lang.com/chapter_3/the_accounts_struct.html#safety-checks for more information. + See https://book.anchor-lang.com/anchor_in_depth/the_accounts_struct.html#safety-checks for more information. ``` To fix this, write a doc comment describing the potential security implications, e.g.: