Skip to content

Conversation

@dcousens
Copy link
Contributor

Chained on #211.

This pull request reworks the internals of Transaction, removing redundant code, abstractions and overall does a cleanup.
Much of the commits are self explanatory, and it should be noted this pull request does not rework the Transaction tests to be data driven. That is still to be done.

Comparison link: https://github.com/dcousens/bitcoinjs-lib/compare/tests...txclean

@coveralls
Copy link

Coverage Status

Coverage increased (+0.45%) when pulling fd07912 on dcousens:txclean into 55ff383 on bitcoinjs:master.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we expose these constants anywhere? It seems like devs might need them for some of the functions (namely Transaction.prototype.sign).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A fair point, we don't yet. Thoughts on how they should be exposed? Transaction.SIGHASH_ALL?

Copy link
Contributor

Choose a reason for hiding this comment

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

That would work. Is this more of a Transaction thing, or a Script thing?

Copy link
Contributor

Choose a reason for hiding this comment

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

(or scripts)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hash type modifiers are purely a Transaction thing. They are added to the signatures, but are most important in the hashing of the Transaction for signing.

Copy link
Contributor

Choose a reason for hiding this comment

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

Transaction.SIGHASH_ALL it is then.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kyledrake I'll expose these in the follow up TransactionBuilder pull request, simply because it is necessary for them to be exposed in that PR.

@kyledrake
Copy link
Contributor

I think the SIGHASH constants should be exposed somewhere for devs (Transaction or Script?), otherwise I'm +1 on this.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.44%) when pulling 45a361c on dcousens:txclean into 55ff383 on bitcoinjs:master.

@dcousens dcousens mentioned this pull request Jun 15, 2014
@coveralls
Copy link

Coverage Status

Coverage increased (+0.44%) when pulling c34c143 on dcousens:txclean into 55ff383 on bitcoinjs:master.

@dcousens
Copy link
Contributor Author

Rebased on master. Added fixes for the Wallet tests as discussed on IRC.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.02%) when pulling c0e5393 on dcousens:txclean into bf42341 on bitcoinjs:master.

Copy link
Contributor

Choose a reason for hiding this comment

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

The error message here suggests that we are just expecting Transaction. It could be a Transaction or transaction id as a string.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in c5252fc.

weilu added a commit that referenced this pull request Jun 16, 2014
@weilu weilu merged commit 4f0ae1a into bitcoinjs:master Jun 16, 2014
@dcousens dcousens deleted the txclean branch June 16, 2014 05:47
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.

4 participants