Apply suggestions from code review
This commit is contained in:
parent
33c56fcf77
commit
707f51f885
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue