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
Remove instantiable Address #401
Conversation
|
||
assert(false, this.toString() + ' has no matching Script') | ||
} catch (e) { | ||
throw new Error(address + ' is not a valid ' + network + ' address') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does validate have to throw on invalid? Consider returning a boolean instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
@dcousens Let's finish this. |
@weilu sounds good, I'll get back on this today. |
Integration tests/coveralls failing for unrelated reasons. @weilu please review. The API could maybe change, but lets do that in a different PR, I want to get this merged and leave the API bike shedding separate. @jprichardson feel free to review also. :) |
Intend to merge ASAP. Any comments/qualms? |
Most of it looks good. I like this change. My only thought is not removing the tests (you'd still keep this commit as is 16a711b i.e. remove these tests as you have). But by not removing the other tests and maybe just changing them to errors helps to communicate how the expectations have changed. I'm fine with it as is, just a thought. Also, what's with bundling the commit to add the network into TxBuilder into this PR? |
fe63cb3
to
1a4000c
Compare
@jprichardson I rebased without that commit and will submit in a different PR. Thanks for the spot. Please merge if happy. |
var version = payload.readUInt8(0) | ||
var hash = payload.slice(1) | ||
|
||
return new Address(hash, version) | ||
return { hash: hash, version: version } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a big fan of the return value of this function. How about splitting this into two functions: hashFromBase58Check
and versionFromBase58Check
?
There will be a PR for adding deprecation warnings on 1.x branch right? |
Of course.
I think that's worth investigating, but we need to do consistently this across all the network sections, and I'd be happy to do that in #425. |
Going to merge, as the issues brought up (here and privately) were all expected:
|
@coveralls, you trippin |
WIP pull request.Ready to merge