Replace SAFETY with CHECK (#11)
This commit is contained in:
parent
73ad095541
commit
b992f4828b
|
@ -147,7 +147,7 @@ will result in an error similar to the following:
|
||||||
Error:
|
Error:
|
||||||
/anchor/tests/unchecked/programs/unchecked/src/lib.rs:15:8
|
/anchor/tests/unchecked/programs/unchecked/src/lib.rs:15:8
|
||||||
Struct field "potentially_dangerous" is unsafe, but is not documented.
|
Struct field "potentially_dangerous" is unsafe, but is not documented.
|
||||||
Please add a `/// SAFETY:` doc comment explaining why no checks through types are necessary.
|
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/chapter_3/the_accounts_struct.html#safety-checks for more information.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -156,7 +156,7 @@ To fix this, write a doc comment describing the potential security implications,
|
||||||
```rust,ignore
|
```rust,ignore
|
||||||
#[derive(Accounts)]
|
#[derive(Accounts)]
|
||||||
pub struct Initialize<'info> {
|
pub struct Initialize<'info> {
|
||||||
/// SAFETY: This is not dangerous because we don't read or write from this account
|
/// CHECK: This is not dangerous because we don't read or write from this account
|
||||||
pub potentially_dangerous: UncheckedAccount<'info>
|
pub potentially_dangerous: UncheckedAccount<'info>
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue