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 support for Preview 10 operations when assembling Soroban transactions. #108

Merged
merged 8 commits into from
Jul 11, 2023

Conversation

Shaptic
Copy link
Contributor

@Shaptic Shaptic commented Jul 10, 2023

This builds on #107 to allow BumpFootprintExpirationOps and RestoreFootprintOps to be assembled when users call simulateTransaction and prepareTransaction.

const invokeOp: Operation.InvokeHostFunction = raw.operations[0];
txnBuilder.addOperation(
Operation.invokeHostFunction({
source: invokeOp.source,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

note that previously we weren't copying the source


case "bumpFootprintExpiration":
const bumpOp: Operation.BumpFootprintExpiration = raw.operations[0];
txnBuilder.addOperation(
Copy link
Contributor

Choose a reason for hiding this comment

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

since this and restore case are not merging any data from simulation, can it reduce to txnBuilder.addOperation(raw.operations[0]), or I may be missing a subtlety.

Copy link
Contributor Author

@Shaptic Shaptic Jul 11, 2023

Choose a reason for hiding this comment

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

I thought so, too, but kept getting some TypeScript errors... tried it again in ea8ccb3 and it worked 🤦 Great call, thank you!

@Shaptic Shaptic merged commit a615931 into main Jul 11, 2023
3 checks passed
@Shaptic Shaptic deleted the preview.10-sim-bump-restore branch July 11, 2023 00:52
Shaptic added a commit that referenced this pull request Jul 11, 2023
Shaptic added a commit that referenced this pull request Jul 11, 2023
* Add test case for #108
* Upgrade all dependencies to their latest minor versions
@Shaptic Shaptic self-assigned this Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants