Apply suggestions from code review

This commit is contained in:
Armani Ferrante 2022-02-11 10:14:52 -05:00 committed by GitHub
parent 33c56fcf77
commit 707f51f885
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -152,7 +152,7 @@ pub fn account(
fn try_deserialize(buf: &mut &[u8]) -> std::result::Result<Self, ProgramError> {
// Header is always 8 bytes.
if buf.len() < anchor_lang::accounts::header::HEADER_LEN {
return Err(anchor_lang::__private::ErrorCode::AccountDiscriminatorNotFound.into());
return Err(anchor_lang::error::ErrorCode::AccountDiscriminatorNotFound.into());
}
let given_disc = anchor_lang::accounts::header::read_discriminator(&buf);
if &#discriminator != given_disc {

View File

@ -162,7 +162,7 @@ pub fn generate_constraint_zeroed(f: &Field, _c: &ConstraintZeroed) -> proc_macr
__header_bytes.copy_from_slice(&__data[..8]);
let __header = u64::from_le_bytes(__header_bytes);
if __header != 0 {
return Err(anchor_lang::__private::ErrorCode::ConstraintZero.into());
return Err(anchor_lang::error::ErrorCode::ConstraintZero.into());
}
#header_write