diff --git a/index.js b/index.js index 9fadddf..092effa 100644 --- a/index.js +++ b/index.js @@ -8,6 +8,7 @@ bitcore.crypto.ECDSA = require('./lib/crypto/ecdsa'); bitcore.crypto.Hash = require('./lib/crypto/hash'); bitcore.crypto.Random = require('./lib/crypto/random'); bitcore.crypto.Point = require('./lib/crypto/point'); +bitcore.crypto.Signature = require('./lib/crypto/signature'); // encoding bitcore.encoding = {}; @@ -27,7 +28,6 @@ bitcore.Opcode = require('./lib/opcode'); bitcore.PrivateKey = require('./lib/privatekey'); bitcore.PublicKey = require('./lib/publickey'); bitcore.Script = require('./lib/script'); -bitcore.Signature = require('./lib/signature'); bitcore.Transaction = require('./lib/transaction'); bitcore.Txin = require('./lib/txin'); bitcore.Txout = require('./lib/txout'); diff --git a/lib/crypto/ecdsa.js b/lib/crypto/ecdsa.js index 842be38..8735367 100644 --- a/lib/crypto/ecdsa.js +++ b/lib/crypto/ecdsa.js @@ -2,16 +2,18 @@ var BN = require('./bn'); var Point = require('./point'); +var Signature = require('./signature'); var Random = require('./random'); var PublicKey = require('../publickey'); var PrivateKey = require('../privatekey'); -var Signature = require('../signature'); var ECDSA = function ECDSA(obj) { - if (!(this instanceof ECDSA)) + if (!(this instanceof ECDSA)) { return new ECDSA(obj); - if (obj) + } + if (obj) { this.set(obj); + } }; ECDSA.prototype.set = function(obj) { diff --git a/lib/signature.js b/lib/crypto/signature.js similarity index 99% rename from lib/signature.js rename to lib/crypto/signature.js index 55d764c..7d9e725 100644 --- a/lib/signature.js +++ b/lib/crypto/signature.js @@ -1,6 +1,6 @@ 'use strict'; -var BN = require('./crypto/bn'); +var BN = require('./bn'); var Signature = function Signature(r, s) { if (!(this instanceof Signature)) diff --git a/test/crypto/ecdsa.js b/test/crypto/ecdsa.js index 1066b28..e41559e 100644 --- a/test/crypto/ecdsa.js +++ b/test/crypto/ecdsa.js @@ -4,9 +4,9 @@ var should = require('chai').should(); var bitcore = require('../..'); var ECDSA = bitcore.crypto.ECDSA; var Hash = bitcore.crypto.Hash; +var Signature = bitcore.crypto.Signature; var PrivateKey = bitcore.PrivateKey; var PublicKey = bitcore.PublicKey; -var Signature = bitcore.Signature; var BN = bitcore.crypto.BN; describe('ECDSA', function() { diff --git a/test/signature.js b/test/crypto/signature.js similarity index 98% rename from test/signature.js rename to test/crypto/signature.js index 730b5ab..4774082 100644 --- a/test/signature.js +++ b/test/crypto/signature.js @@ -1,9 +1,9 @@ 'use strict'; var should = require('chai').should(); -var bitcore = require('..'); +var bitcore = require('../..'); var BN = bitcore.crypto.BN; -var Signature = bitcore.Signature; +var Signature = bitcore.crypto.Signature; describe('Signature', function() {