diff --git a/browser/vendor_load.js b/browser/vendor_load.js index 9a4251f..4e97483 100644 --- a/browser/vendor_load.js +++ b/browser/vendor_load.js @@ -1,5 +1,5 @@ // load modules needed for testing in the browser -var fs = require('fs'); +//var fs = require('fs'); diff --git a/test/test.Script.js b/test/test.Script.js index 93085cc..caee5cb 100644 --- a/test/test.Script.js +++ b/test/test.Script.js @@ -6,6 +6,7 @@ var bitcore = require('../bitcore'); var should = chai.should(); var ScriptModule = bitcore.Script; +var Address = bitcore.Address.class(); var Script; describe('Script', function() { @@ -20,6 +21,18 @@ describe('Script', function() { var s = new Script(); should.exist(s); }); + it('should be able to create Script from Address', function() { + var addr = new Address('1J57QmkaQ6JohJoQyaUJwngJ2vTQ3C6gHi'); + var script = Script.createPubKeyHashOut(addr.payload()); + should.exist(script); + script.isPubkeyHash().should.be.true; + }); + it('isP2SH should work', function() { + var addr = new Address('1J57QmkaQ6JohJoQyaUJwngJ2vTQ3C6gHi'); + var script = Script.createPubKeyHashOut(addr.payload()); + script.isP2SH.bind(script).should.not.throw(Error); + script.isP2SH().should.be.false; + }); });