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

added clearing and adding operations at a specified index #757

Merged
merged 3 commits into from
Jun 28, 2024

Conversation

JuanRdBO
Copy link
Contributor

Summary of changes

  • Added two methods: addOperationAtIndex and clearOperationAtIndex in the TransactionBuilder class

Use Case

I wanted to add them because I was trying to change the amount of one operations after cloning and realized it would that much easier if I could just clear an operation at a specified index and then add it add the updated operation at the same index again.

Copy link
Contributor

@Shaptic Shaptic left a comment

Choose a reason for hiding this comment

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

I love this idea! Thank you for the PR. Could you add some unit tests that demonstrate that they function? You can reference /test/unit/transaction_builder_test.js for existing cases and run them with yarn test.

src/transaction_builder.js Outdated Show resolved Hide resolved
@JuanRdBO JuanRdBO requested a review from Shaptic June 28, 2024 18:10
@Shaptic
Copy link
Contributor

Shaptic commented Jun 28, 2024

Can you run (and commit) yarn fmt? Linter is complaining.

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