-
Notifications
You must be signed in to change notification settings - Fork 92
feat: more ctoken extensions #2080
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -127,7 +127,7 @@ impl<R: Rpc> Compressor<R> { | |
| .ok_or_else(|| anyhow::anyhow!("Account missing compressible extension"))?; | ||
|
|
||
| // Determine owner based on compress_to_pubkey flag | ||
| let compressed_token_owner = if compressible_ext.compress_to_pubkey != 0 { | ||
| let compressed_token_owner = if compressible_ext.info.compress_to_pubkey != 0 { | ||
| account_state.pubkey // Use account pubkey for PDAs | ||
| } else { | ||
| Pubkey::new_from_array(account_state.account.owner.to_bytes()) // Use original owner | ||
|
|
@@ -136,14 +136,25 @@ impl<R: Rpc> Compressor<R> { | |
| let owner_index = packed_accounts.insert_or_get(compressed_token_owner); | ||
|
|
||
| // Extract rent_sponsor from extension | ||
| let rent_sponsor = Pubkey::new_from_array(compressible_ext.rent_sponsor); | ||
| let rent_sponsor = Pubkey::new_from_array(compressible_ext.info.rent_sponsor); | ||
| let rent_sponsor_index = packed_accounts.insert_or_get(rent_sponsor); | ||
|
|
||
| // Handle delegate if present | ||
| let delegate_index = account_state | ||
| .account | ||
| .delegate | ||
| .map(|delegate| { | ||
| let delegate_pubkey = Pubkey::new_from_array(delegate.to_bytes()); | ||
| packed_accounts.insert_or_get(delegate_pubkey) | ||
| }) | ||
| .unwrap_or(0); | ||
|
|
||
| indices_vec.push(CompressAndCloseIndices { | ||
| source_index, | ||
| mint_index, | ||
| owner_index, | ||
| rent_sponsor_index, | ||
| delegate_index, | ||
| }); | ||
|
Comment on lines
+142
to
158
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: rg -n --type=rust 'struct CompressAndCloseIndices' -A 10Repository: Lightprotocol/light-protocol Length of output: 200 🏁 Script executed: rg -n --type=rust 'delegate_index' -B 3 -A 3Repository: Lightprotocol/light-protocol Length of output: 27055 🏁 Script executed: rg -n --type=rust 'CompressAndCloseIndices' --type=rust -A 5 | grep -E '(delegate_index|fn |struct )' | head -40Repository: Lightprotocol/light-protocol Length of output: 642 🏁 Script executed: sed -n '100,170p' forester/src/compressible/compressor.rsRepository: Lightprotocol/light-protocol Length of output: 3016 🏁 Script executed: rg -n 'struct CompressAndCloseIndices' -A 10 forester/src/compressible/compressor.rsRepository: Lightprotocol/light-protocol Length of output: 54 🏁 Script executed: rg -n 'has_delegate' forester/src/compressible/compressor.rs -B 2 -A 2Repository: Lightprotocol/light-protocol Length of output: 54 Add disambiguation for The delegate index defaults to Similar code patterns (e.g.,
🤖 Prompt for AI Agents |
||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.