Skip to content

Remove instanceof since we can't actually create the ecurve.Point #274

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

Closed
wants to merge 1 commit into from

Conversation

glorat
Copy link

@glorat glorat commented Sep 5, 2014

No description provided.

@glorat
Copy link
Author

glorat commented Sep 5, 2014

This is how I'm fixing my own issue #255

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.14%) when pulling 201a30e on glorat:master into dce2690 on bitcoinjs:master.

@dcousens
Copy link
Contributor

dcousens commented Sep 8, 2014

Could also be replaced with just Q.affineX which is a property with lazy evaluating side effects.

As to why this stops sinon from detecting that TransactionBuilder.sign has been called with the correct arguments? I have absolutely no idea.

@glorat
Copy link
Author

glorat commented Sep 8, 2014

It beats me too.

As discussed over IRC, since signing is deterministic, one could replace all the sinon interception with an assertion that the signature payload is as expected. This would be a stronger test than the assertion that the sign method was called.

Unfortunately, that's beyond the scope of my minimal volunteerism for now!

@weilu
Copy link
Contributor

weilu commented Sep 9, 2014

It sounds to me it's more like a problem that sinon exposed which needs to be addressed over at the ecurve project.

@dcousens
Copy link
Contributor

dcousens commented Sep 9, 2014

As discussed in #280, the reason this fails without the affineX is due to its lazy evaluation, resulting in a deep equality difference; which is used by calledWith in sinon.

edit: resolved this problem separately

@dcousens
Copy link
Contributor

@glorat does #257 help your situation?

@dcousens dcousens modified the milestone: 2.0.0 Sep 20, 2014
@weilu
Copy link
Contributor

weilu commented Sep 22, 2014

@glorat can you clean up (squash/rebase) the git history so we can get this merged?

@dcousens
Copy link
Contributor

And remove the toString
On Sep 22, 2014 10:55 PM, "Wei Lu" [email protected] wrote:

@glorat https://github.com/glorat can you clean up (squash/rebase) the
git history so we can get this merged?


Reply to this email directly or view it on GitHub
#274 (comment)
.

@glorat
Copy link
Author

glorat commented Sep 22, 2014

That will be an exercise for my new git skills! Will try...

@glorat
Copy link
Author

glorat commented Sep 25, 2014

Cleaned up as requested and CI passes this time thanks to the other changes.

I'm agnostic as to whether you guys go with this or something else like #257. For my part, I'll be using this patch locally since it works for me.

@weilu
Copy link
Contributor

weilu commented Sep 27, 2014

@dcousens the change looks good to me. Recently I have actually bumped into something like this -- our staging doesn't work because of an instanceof check: https://hive-js.herokuapp.com/. Shall we do a global remove, or alternatively replace them with verbose duck typing method checks?

@dcousens
Copy link
Contributor

I feel like it's inconsistent to only do it here. Thoughts on params object for HDNode constructor?
On Sep 27, 2014 1:20 PM, "Wei Lu" [email protected] wrote:

@dcousens https://github.com/dcousens the change looks good to me.
Recently I have actually bumped into something like this -- our staging
doesn't work because of an instanceof check:
https://hive-js.herokuapp.com/. Shall we do a global remove, or
alternatively replace them with verbose duck typing method checks?


Reply to this email directly or view it on GitHub
#274 (comment)
.

@weilu
Copy link
Contributor

weilu commented Sep 27, 2014

Why HDNode?

@dcousens
Copy link
Contributor

if (K instanceof BigInteger) {

@glorat
Copy link
Author

glorat commented Oct 15, 2014

Closing this now as there are other proposals that are looking better

@glorat glorat closed this Oct 15, 2014
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