Browse Source

move Signature to crypto/

patch-2
Manuel Araoz 10 years ago
parent
commit
1f3d7d9872
  1. 2
      index.js
  2. 8
      lib/crypto/ecdsa.js
  3. 2
      lib/crypto/signature.js
  4. 2
      test/crypto/ecdsa.js
  5. 4
      test/crypto/signature.js

2
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');

8
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) {

2
lib/signature.js → 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))

2
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() {

4
test/signature.js → 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() {
Loading…
Cancel
Save