Skip to content

Conversation

@kyledrake
Copy link
Contributor

Default-ize the sequence rather than use a number, and default to bytes
for input. I doubt anybody ever uses this anyways.

Remove weird convenience code, and remove wallet logic. Checking a TX's
affects on a wallet should be managed by the wallet object.

Remove parsing for the weirder SIGHASH types. People use this library
for creating SIGHASH_ALL transactions, and I don't see the need to
support these other types at the moment since this library's more used
for wallets than for hardcore bitcoin tx analysis/creation. They weren't
tested anyways.

Add note about potentially improving performance by providing
pubkey/address. Deriving from the private key is slower, that
information should probably be cached by the end user.

The most controversial thing I did here was remove parsing for weird SIGHASH types. This library is used for creating SIGHASH_ALL txes, and I don't think it needs to support these other types, but I'm OK to get some pushback on this if there's disagreement.

This brings our transaction.js testing coverage up quite a bit:
screen shot 2014-03-20 at 3 48 51 pm

Default-ize the sequence rather than use a number, and default to bytes
for input. I doubt anybody ever uses this anyways.

Remove weird convenience code, and remove wallet logic. Checking a TX's
affects on a wallet should be managed by the wallet object.

Remove parsing for the weirder SIGHASH types. People use this library
for creating SIGHASH_ALL transactions, and I don't see the need to
support these other types at the moment since this library's more used
for wallets than for hardcore bitcoin tx analysis/creation. They weren't
tested anyways.

Add note about potentially improving performance by providing
pubkey/address. Deriving from the private key is slower, that
information should probably be cached by the end user.
@kyledrake
Copy link
Contributor Author

Also worth noting is that I haven't tested my changes to sequence in a live transaction yet, so if the conversion is incorrect, it's possible that I broke transaction serialization, but I believe the tests would have caught it.

@weilu
Copy link
Contributor

weilu commented Mar 21, 2014

🙋 pushback.

Can we add tests to the sighash types that are already supported instead of removing them for the sake of test coverage?

@weilu
Copy link
Contributor

weilu commented Mar 21, 2014

I dig the rest of the cleanup. I remember somewhere in the code comment someone mentioned that transaction and wallet has circular dependencies. This resolves that too.

@kyledrake
Copy link
Contributor Author

I added back the sighash stuff. Let me know if this looks okay and I'll merge.

weilu added a commit that referenced this pull request Mar 21, 2014
Many cleanups to Transaction, see detailed.
@weilu weilu merged commit 35747fb into bitcoinjs:master Mar 21, 2014
louisinger added a commit to louisinger/liquidjs-lib that referenced this pull request Oct 31, 2022
* wip

* fix reissuance test

* remove .only

* fix after review

* remove '!'

* reissuanceBlindingArgs

* sanity checks

* sanity checks

* build files

* remove check on inflationKeys

* better checks

* format

* clean checks

* Update ts_src/psetv2/input.ts

Co-authored-by: Pietralberto Mazza <18440657+altafan@users.noreply.github.com>

* checks

* remove issuance values sanity checks

Co-authored-by: altafan <18440657+altafan@users.noreply.github.com>
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