Skip to content

Commit 8ff9974

Browse files
feat: add batch compress tokens (#1718)
* feat: add batch compress tokens fix ctoken js test: mint-to with wrong authority now throws inside spl program test and optimize batch compress test: add failing tests and fix mint to failing tests fix: token22 compression feat: add single amount to batch compress * fix: comments * perf: remove unnecessary seed check * perf: remove unused input data * perf: switch ctoken system program cpi to with_readonly * feat: add with tx hash to transfer ix * chore: add transfer2 to ensure transfer backwards compatibility * stash pre claude * feat: stateless.js add decodeInstructionDataInvokeCpiWithReadOnly * stash * stash * remove transaction2 * cleanup * chore: review 1718 (#1725) * chore: expect index in batch compress * chore: is_valid_token_pool_pda return Result * test: add randomized test for BatchCompressInstructionData * fix: mint lookup --------- Co-authored-by: Swen Schäferjohann <42959314+SwenSchaeferjohann@users.noreply.github.com>
1 parent 119a26e commit 8ff9974

File tree

37 files changed

+1877
-374
lines changed

37 files changed

+1877
-374
lines changed

.github/workflows/light-examples-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
include:
3535
- program: token-escrow-test
3636
sub-tests: '[
37-
"cargo test-sbf -p token-escrow -- --test-threads=1"
37+
"cargo test-sbf -p token-escrow"
3838
]'
3939
- program: counter-test
4040
sub-tests: '["cargo test-sbf -p counter"]'

.github/workflows/light-system-programs-tests.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,10 @@ jobs:
7878
for subtest in "${sub_tests[@]}"
7979
do
8080
echo "$subtest"
81-
eval "RUSTFLAGS=\"-D warnings\" $subtest"
81+
82+
RUSTFLAGS="-D warnings" eval "$subtest"
83+
if [ "$subtest" == "cargo-test-sbf -p e2e-test" ]; then
84+
pnpm --filter @lightprotocol/programs run build-compressed-token-small
85+
RUSTFLAGS="-D warnings" eval "$subtest -- --test test_10_all"
86+
fi
8287
done

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,5 @@ output.txt
8484
.nx/workspace-data
8585
output1.txt
8686
.zed
87+
88+
**/.claude/settings.local.json

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/anchor/token-escrow/src/escrow_with_compressed_pda/escrow.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ pub fn cpi_compressed_token_transfer_pda<'info>(
211211
compress_or_decompress_amount: None,
212212
cpi_context: Some(cpi_context),
213213
lamports_change_account_merkle_tree_index: None,
214+
with_transaction_hash: false,
214215
};
215216

216217
let mut inputs = Vec::new();

examples/anchor/token-escrow/src/escrow_with_compressed_pda/withdrawal.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ pub fn cpi_compressed_token_withdrawal<'info>(
206206
compress_or_decompress_amount: None,
207207
cpi_context: Some(cpi_context),
208208
lamports_change_account_merkle_tree_index: None,
209+
with_transaction_hash: false,
209210
};
210211

211212
let mut inputs = Vec::new();

examples/anchor/token-escrow/src/escrow_with_pda/escrow.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ pub fn cpi_compressed_token_transfer<'info>(
9393
compress_or_decompress_amount: None,
9494
cpi_context: None,
9595
lamports_change_account_merkle_tree_index: None,
96+
with_transaction_hash: false,
9697
};
9798

9899
let mut inputs = Vec::new();

examples/anchor/token-escrow/src/escrow_with_pda/sdk.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ pub fn create_withdrawal_escrow_instruction(
129129
None,
130130
None,
131131
&[],
132+
false,
132133
);
133134

134135
let merkle_tree_indices = add_and_get_remaining_account_indices(

examples/anchor/token-escrow/src/escrow_with_pda/withdrawal.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ pub fn withdrawal_cpi_compressed_token_transfer<'info>(
7272
compress_or_decompress_amount: None,
7373
cpi_context: None,
7474
lamports_change_account_merkle_tree_index: None,
75+
with_transaction_hash: false,
7576
};
7677

7778
let mut inputs = Vec::new();

forester/tests/batched_state_async_indexer_test.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,7 @@ async fn compressed_token_transfer<R: RpcConnection, I: Indexer<R>>(
735735
None,
736736
false,
737737
&[],
738+
false,
738739
)
739740
.unwrap();
740741
println!(

0 commit comments

Comments
 (0)