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

token-client: Refactor Message creation to use the same instructions everywhere #6494

Merged
merged 1 commit into from
Mar 26, 2024

Conversation

joncinque
Copy link
Contributor

Problem

Currently, the token client uses Message::new_with_nonce for nonce transactions, which means that we need to do some copy-pasta on the instructions before simulating to find the compute unit limit.

Solution

Extract the part from Message::new_with_nonce that adds an instruction to the transaction.

This actually fixes a bug where Message::new_with_nonce was taking token_instructions instead of instructions.

self.nonce_blockhash,
) {
let mut message = Message::new_with_nonce(
token_instructions.to_vec(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤕 Nice catch

@joncinque joncinque merged commit 886693d into solana-labs:master Mar 26, 2024
31 checks passed
@joncinque joncinque deleted the bh branch March 26, 2024 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants