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

fix sourceTXID as default #101

Merged
merged 3 commits into from
Jul 3, 2024
Merged

Conversation

shruggr
Copy link

@shruggr shruggr commented Jul 2, 2024

Description of Changes

When using Utxo.fromUtxo, sourceTXID was not being set. This causes cascading issue when trying to sign a transaction, serialize it, or calculating fees. I've included two updates.

  1. Utxo.fromUtxo now sets sourceTXID on the input it returns.
  2. Transaction.toBinary and Transaction.verify now check first if a sourceTXID is populated and uses that before falling back to sourceTransaction.id()/sourceTransaction.hash()

Linked Issues / Tickets

Testing Procedure

Describe the tests you've added or any testing steps you've taken.

  • I have added new unit tests
  • All tests pass locally
  • I have tested manually in my local environment

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have updated CHANGELOG.md with my changes
  • I have run npm run doc and npm run lint one final time before requesting a review
  • I have run npm version patch so that my changes will trigger a new version to be released when they are merged

@shruggr
Copy link
Author

shruggr commented Jul 3, 2024

@BraydenLangley can you please review this ASAP? @rohenaz has rewritten the js-1sat-ord package to use ts-sdk, and we're hoping to get it out before the holiday.

Thanks

Copy link
Collaborator

@BraydenLangley BraydenLangley left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@BraydenLangley BraydenLangley merged commit 9690480 into bitcoin-sv:master Jul 3, 2024
4 checks passed
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.

None yet

3 participants