@@ -6,26 +6,26 @@ macro_rules! impl_try_from_bytes_with_discriminator_zero_copy {
66 data: & [ u8 ] ,
77 ) -> Result <& Self , :: solana_program:: program_error:: ProgramError > {
88 if data. len( ) < 8 {
9- return Err ( :: solana_program :: program_error :: ProgramError :: InvalidAccountData ) ;
9+ return Err ( $crate :: error :: DlpError :: InvalidDataLength . into ( ) ) ;
1010 }
1111 if Self :: discriminator( ) . to_bytes( ) . ne( & data[ ..8 ] ) {
12- return Err ( :: solana_program :: program_error :: ProgramError :: InvalidAccountData ) ;
12+ return Err ( $crate :: error :: DlpError :: InvalidDiscriminator . into ( ) ) ;
1313 }
1414 bytemuck:: try_from_bytes:: <Self >( & data[ 8 ..] ) . or( Err (
15- :: solana_program :: program_error :: ProgramError :: InvalidAccountData ,
15+ $crate :: error :: DlpError :: InvalidDelegationRecordData . into ( ) ,
1616 ) )
1717 }
1818 pub fn try_from_bytes_with_discriminator_mut(
1919 data: & mut [ u8 ] ,
2020 ) -> Result <& mut Self , :: solana_program:: program_error:: ProgramError > {
2121 if data. len( ) < 8 {
22- return Err ( :: solana_program :: program_error :: ProgramError :: InvalidAccountData ) ;
22+ return Err ( $crate :: error :: DlpError :: InvalidDataLength . into ( ) ) ;
2323 }
2424 if Self :: discriminator( ) . to_bytes( ) . ne( & data[ ..8 ] ) {
25- return Err ( :: solana_program :: program_error :: ProgramError :: InvalidAccountData ) ;
25+ return Err ( $crate :: error :: DlpError :: InvalidDiscriminator . into ( ) ) ;
2626 }
2727 bytemuck:: try_from_bytes_mut:: <Self >( & mut data[ 8 ..] ) . or( Err (
28- :: solana_program :: program_error :: ProgramError :: InvalidAccountData ,
28+ $crate :: error :: DlpError :: InvalidDelegationRecordData . into ( ) ,
2929 ) )
3030 }
3131 }
@@ -40,13 +40,13 @@ macro_rules! impl_try_from_bytes_with_discriminator_borsh {
4040 data: & [ u8 ] ,
4141 ) -> Result <Self , :: solana_program:: program_error:: ProgramError > {
4242 if data. len( ) < 8 {
43- return Err ( :: solana_program :: program_error :: ProgramError :: InvalidAccountData ) ;
43+ return Err ( $crate :: error :: DlpError :: InvalidDataLength . into ( ) ) ;
4444 }
4545 if Self :: discriminator( ) . to_bytes( ) . ne( & data[ ..8 ] ) {
46- return Err ( :: solana_program :: program_error :: ProgramError :: InvalidAccountData ) ;
46+ return Err ( $crate :: error :: DlpError :: InvalidDiscriminator . into ( ) ) ;
4747 }
4848 Self :: try_from_slice( & data[ 8 ..] ) . or( Err (
49- :: solana_program :: program_error :: ProgramError :: InvalidAccountData ,
49+ $crate :: error :: DlpError :: InvalidDelegationRecordData . into ( ) ,
5050 ) )
5151 }
5252 }
0 commit comments