We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deserializing an PriceUpdateV2 account info using AnchorDeserialize::try_from_slice(data) fails.
PriceUpdateV2
AnchorDeserialize::try_from_slice(data)
Note: Using PriceUpdateV2::try_deserialize(&mut data) works.
PriceUpdateV2::try_deserialize(&mut data)
The PriceUpdateV2 structure have a size of 136 bytes, while LEN is 134 and onchain accounts are 134 bytes.
LEN
https://explorer.solana.com/address/7UVimffxr9ow1uXYxsr4LHAcV58mLzhmwaeKvJ1pjLiE?cluster=devnet
#[account] #[derive(BorshSchema)] pub struct PriceUpdateV2 { pub write_authority: Pubkey, pub verification_level: VerificationLevel, pub price_message: PriceFeedMessage, pub posted_slot: u64, } impl PriceUpdateV2 { pub const LEN: usize = 8 + 32 + 2 + 32 + 8 + 8 + 4 + 8 + 8 + 8 + 8 + 8; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Issue
Deserializing an
PriceUpdateV2
account info usingAnchorDeserialize::try_from_slice(data)
fails.Note: Using
PriceUpdateV2::try_deserialize(&mut data)
works.Cause
The
PriceUpdateV2
structure have a size of 136 bytes, whileLEN
is 134 and onchain accounts are 134 bytes.Onchain Account Example
https://explorer.solana.com/address/7UVimffxr9ow1uXYxsr4LHAcV58mLzhmwaeKvJ1pjLiE?cluster=devnet
PriceUpdateV2 struct in the code
The text was updated successfully, but these errors were encountered: