-
Notifications
You must be signed in to change notification settings - Fork 87
feat: more ctoken extensions opt compressible ctoken #2156
New issue
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
feat: more ctoken extensions opt compressible ctoken #2156
Conversation
|
Important Review skippedToo many files! 39 files out of 189 files are above the max files limit of 150. You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| } | ||
|
|
||
| // Handle withheld_transfer_fee (always add, not overwrite) | ||
| if withheld_transfer_fee > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: add comment:
Defensive so that it is always possible to compress and decompress ctoken accounts. It should not be possible to set withheld_transfer_fee to non zero.
8c0b2e7 to
3640e91
Compare
| /// Calculates the size of a ctoken account based on which extensions are present. | ||
| /// | ||
| /// Note: Compression info is now embedded in the base struct (CTokenZeroCopyMeta), | ||
| /// so there's no separate compressible extension parameter. | ||
| /// | ||
| /// # Arguments | ||
| /// * `extensions` - Optional slice of extension configs | ||
| /// | ||
| /// # Returns | ||
| /// * `Ok(usize)` - The total account size in bytes | ||
| /// * `Err(ZeroCopyError)` - If extension size calculation fails |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this still up2date?
Move compress-and-close tests to new compress_only/ directory: - all.rs: test_compress_and_close_ctoken_with_extensions - default_state.rs: test_create_ctoken_with_frozen_default_state - permanent_delegate.rs: test_compress_and_close_with_permanent_delegate - frozen.rs: test_compress_and_close_frozen - delegated.rs: delegate-related tests Add assert_mint_22_with_all_extensions helper to light-test-utils.
3640e91 to
89dde48
Compare
No description provided.