Skip to content
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

fix: token instruction creation & add onchain check #688

Merged
merged 2 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ pub fn create_escrow_instruction(
) -> Instruction {
let token_owner_pda = get_token_owner_pda(input_params.signer);
let timelock_pda = get_timelock_pda(input_params.signer);
// TODO: separate the creation of inputs and remaining accounts
let (remaining_accounts, inputs) = create_inputs_and_remaining_accounts_checked(
input_params.input_token_data,
input_params.input_merkle_context,
Expand Down
4 changes: 2 additions & 2 deletions programs/compressed-pda/src/invoke/append_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ pub fn insert_output_compressed_accounts_into_state_merkle_tree<
// if the index is higher add the account info to out_merkle_trees_account_infos.
let initial_index = *global_iter;
let mut current_index: u8 = 0;
let end = if *global_iter + ITER_SIZE > inputs.output_state_merkle_tree_account_indices.len() {
inputs.output_state_merkle_tree_account_indices.len()
let end = if *global_iter + ITER_SIZE > inputs.output_compressed_accounts.len() {
inputs.output_compressed_accounts.len()
} else {
*global_iter + ITER_SIZE
};
Expand Down
1 change: 1 addition & 0 deletions programs/compressed-pda/src/invoke_cpi/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ pub fn process_invoke_cpi<'a, 'b, 'c: 'info + 'b, 'info>(
compression_lamports: inputs.compression_lamports,
is_compress: inputs.is_compress,
};
data.check_input_lengths()?;
bench_sbf_end!("cpda_InstructionDataInvoke");
process(data, Some(ctx.accounts.invoking_program.key()), ctx)
}
2 changes: 1 addition & 1 deletion test-programs/compressed-token-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"

[lib]
crate-type = ["cdylib", "lib"]
name = "comrpessed_token_test"
name = "compressed_token_test"

[features]
no-entrypoint = []
Expand Down
Loading