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

Make ScriptTransactionRequest.from clone a given transaction #3076

Closed
arboleya opened this issue Sep 2, 2024 · 0 comments · Fixed by #3097
Closed

Make ScriptTransactionRequest.from clone a given transaction #3076

arboleya opened this issue Sep 2, 2024 · 0 comments · Fixed by #3097
Assignees
Labels
chore Issue is a chore feat Issue is a feature

Comments

@arboleya
Copy link
Member

arboleya commented Sep 2, 2024

Currently, this utility method creates a new instance that references received object.

Quick example:

const base_tx: ScriptTransactionRequest = { .. }

const estimation_tx = ScriptTransactionRequest.from(base_transaction);

estimation_tx.inputs.push(...spendableInputs);

const final_tx = ScriptTransactionRequest.from(base_transaction)

final_tx.inputs.push(...otherSpendableInputs);

// Result: all base_tx, estimation_tx, and final_tx will contain `spendableInputs` and `otherSpendableInputs`

It should ideally clone the received transaction and return a new one, that doesn't reference anything.

@arboleya arboleya added feat Issue is a feature chore Issue is a chore labels Sep 2, 2024
@maschad maschad self-assigned this Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Issue is a chore feat Issue is a feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants