Implement I5 on URI
This commit is contained in:
parent
edea0ad207
commit
42e2c6c525
|
@ -34,6 +34,10 @@ var JSUtil = require('./util/js');
|
|||
* @constructor
|
||||
*/
|
||||
var URI = function(data, knownParams) {
|
||||
if (!(this instanceof URI)) {
|
||||
return new URI(data, knownParams);
|
||||
}
|
||||
|
||||
this.extras = {};
|
||||
this.knownParams = knownParams || [];
|
||||
this.address = this.network = this.amount = this.message = null;
|
||||
|
|
|
@ -68,6 +68,11 @@ describe('URI', function() {
|
|||
}).should.throw(TypeError);
|
||||
});
|
||||
|
||||
it('do not need new keyword', function() {
|
||||
var uri = URI('bitcoin:1DP69gMMvSuYhbnxsi4EJEFufUAbDrEQfj');
|
||||
uri.should.be.instanceof(URI);
|
||||
});
|
||||
|
||||
describe('instantiation from bitcoin uri', function() {
|
||||
/* jshint maxstatements: 25 */
|
||||
var uri;
|
||||
|
|
Loading…
Reference in New Issue