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

add optional prepend to preInstructions method builder #2863

Merged
merged 2 commits into from
Mar 24, 2024

Conversation

Taylor123
Copy link
Contributor

With the recent need to calculate compute units by simulating the Transaction it's become desirable to prepend instructions to the preInstructions. Specifically instructions like ComputeBudgetProgram.setComputeUnitPrice and ComputeBudgetProgram.setComputeUnitLimit should be prepended to the preInstructions array after simulating the transaction.

Copy link

vercel bot commented Mar 21, 2024

@Taylor123 is attempting to deploy a commit to the coral-xyz Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Collaborator

@acheroncrypto acheroncrypto left a comment

Choose a reason for hiding this comment

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

Thanks!

With the recent need to calculate compute units by simulating the Transaction it's become desirable to prepend instructions to the preInstructions.

I don't think it would hurt to merge this, but can't we achieve this with tx.instructions.unshift()?

@Taylor123
Copy link
Contributor Author

if you're using the MethodBuilder rpc method to send the TX, then mutating the tx from the transaction() method wouldn't work, right?

@acheroncrypto
Copy link
Collaborator

Sort of — it would require a bit more setup compared to what we can do with this PR.

Before we merge this, could you also note this change in the CHANGELOG?

@Taylor123
Copy link
Contributor Author

@acheroncrypto added

Copy link
Collaborator

@acheroncrypto acheroncrypto left a comment

Choose a reason for hiding this comment

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

Thank you!

@acheroncrypto acheroncrypto merged commit 4393d73 into coral-xyz:master Mar 24, 2024
46 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants