Ackee-Blockchain / trident

Rust-based framework to Fuzz and Integration test Solana programs to help you ship secure code.
https://ackee.xyz/
MIT License
185 stars 18 forks source link

fix/snapshot's zeroed account as optional #170

Closed Ikrk closed 2 months ago

Ikrk commented 2 months ago

Fixes https://ackeeblockchain.atlassian.net/browse/TRD-62

When using the anchor constraint #[account(zero)], the account exists but the data is empty. This constraint is not handled similarly to the init constraint where the accounts_snapshot field is wrapped in an Option and therefore the deserialization fails and it causes a fuzzing crash.

The expected behavior is that the account should be wrapped in an Option and set to None, in case the data is empty.