Project reorganization.
This commit is contained in:
parent
f3b1c2d292
commit
a2d616da5b
44
bitcore.js
44
bitcore.js
|
@ -14,40 +14,40 @@ requireWhenAccessed('bignum', 'bignum');
|
|||
requireWhenAccessed('base58', 'base58-native');
|
||||
requireWhenAccessed('bufferput', 'bufferput');
|
||||
requireWhenAccessed('buffertools', 'buffertools');
|
||||
requireWhenAccessed('Buffers.monkey', './Buffers.monkey');
|
||||
requireWhenAccessed('Buffers.monkey', './patches/Buffers.monkey');
|
||||
requireWhenAccessed('config', './config');
|
||||
requireWhenAccessed('const', './const');
|
||||
requireWhenAccessed('Deserialize', './Deserialize');
|
||||
requireWhenAccessed('Deserialize', './lib/Deserialize');
|
||||
requireWhenAccessed('log', './util/log');
|
||||
requireWhenAccessed('networks', './networks');
|
||||
requireWhenAccessed('util', './util/util');
|
||||
requireWhenAccessed('EncodedData', './util/EncodedData');
|
||||
requireWhenAccessed('VersionedData', './util/VersionedData');
|
||||
requireWhenAccessed('BinaryParser', './util/BinaryParser');
|
||||
requireWhenAccessed('Address', './Address');
|
||||
requireWhenAccessed('BIP32', './BIP32');
|
||||
requireWhenAccessed('Point', './Point');
|
||||
requireWhenAccessed('Opcode', './Opcode');
|
||||
requireWhenAccessed('Script', './Script');
|
||||
requireWhenAccessed('Transaction', './Transaction');
|
||||
requireWhenAccessed('TransactionBuilder', './TransactionBuilder');
|
||||
requireWhenAccessed('Connection', './Connection');
|
||||
requireWhenAccessed('Peer', './Peer');
|
||||
requireWhenAccessed('Block', './Block');
|
||||
requireWhenAccessed('ScriptInterpreter', './ScriptInterpreter');
|
||||
requireWhenAccessed('Bloom', './Bloom');
|
||||
requireWhenAccessed('Key', './Key');
|
||||
requireWhenAccessed('Address', './lib/Address');
|
||||
requireWhenAccessed('BIP32', './lib/BIP32');
|
||||
requireWhenAccessed('Point', './lib/Point');
|
||||
requireWhenAccessed('Opcode', './lib/Opcode');
|
||||
requireWhenAccessed('Script', './lib/Script');
|
||||
requireWhenAccessed('Transaction', './lib/Transaction');
|
||||
requireWhenAccessed('TransactionBuilder', './lib/TransactionBuilder');
|
||||
requireWhenAccessed('Connection', './lib/Connection');
|
||||
requireWhenAccessed('Peer', './lib/Peer');
|
||||
requireWhenAccessed('Block', './lib/Block');
|
||||
requireWhenAccessed('ScriptInterpreter', './lib/ScriptInterpreter');
|
||||
requireWhenAccessed('Bloom', './lib/Bloom');
|
||||
requireWhenAccessed('Key', './lib/Key');
|
||||
Object.defineProperty(module.exports, 'KeyModule', {get: function() {
|
||||
console.log('KeyModule is deprecated.');
|
||||
return require('bindings')('KeyModule');
|
||||
}});
|
||||
requireWhenAccessed('SINKey', './SINKey');
|
||||
requireWhenAccessed('SIN', './SIN');
|
||||
requireWhenAccessed('PrivateKey', './PrivateKey');
|
||||
requireWhenAccessed('RpcClient', './RpcClient');
|
||||
requireWhenAccessed('Wallet', './Wallet');
|
||||
requireWhenAccessed('WalletKey', './WalletKey');
|
||||
requireWhenAccessed('PeerManager', './PeerManager');
|
||||
requireWhenAccessed('SINKey', './lib/SINKey');
|
||||
requireWhenAccessed('SIN', './lib/SIN');
|
||||
requireWhenAccessed('PrivateKey', './lib/PrivateKey');
|
||||
requireWhenAccessed('RpcClient', './lib/RpcClient');
|
||||
requireWhenAccessed('Wallet', './lib/Wallet');
|
||||
requireWhenAccessed('WalletKey', './lib/WalletKey');
|
||||
requireWhenAccessed('PeerManager', './lib/PeerManager');
|
||||
module.exports.Buffer = Buffer;
|
||||
|
||||
if (typeof process.versions === 'undefined') {
|
||||
|
|
|
@ -5,7 +5,7 @@ var run = function() {
|
|||
var bitcore = require('../bitcore');
|
||||
var networks = bitcore.networks;
|
||||
var Peer = bitcore.Peer;
|
||||
var PeerManager = require('soop').load('../PeerManager', {
|
||||
var PeerManager = require('soop').load('../lib/PeerManager', {
|
||||
network: networks.testnet
|
||||
});
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ var run = function() {
|
|||
var Address = bitcore.Address;
|
||||
var Script = bitcore.Script;
|
||||
var coinUtil = bitcore.util;
|
||||
var PeerManager = require('soop').load('../PeerManager', {
|
||||
var PeerManager = require('soop').load('../lib/PeerManager', {
|
||||
network: networks.testnet
|
||||
});
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
'use strict';
|
||||
var imports = require('soop').imports();
|
||||
var coinUtil = imports.coinUtil || require('./util/util');
|
||||
var parent = imports.parent || require('./util/VersionedData');
|
||||
var networks = imports.networks || require('./networks');
|
||||
var coinUtil = imports.coinUtil || require('../util');
|
||||
var parent = imports.parent || require('../util/VersionedData');
|
||||
var networks = imports.networks || require('../networks');
|
||||
var Script = imports.Script || require('./Script');
|
||||
|
||||
function Address() {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
var imports = require('soop').imports();
|
||||
var base58 = imports.base58 || require('base58-native').base58;
|
||||
var coinUtil = imports.coinUtil || require('./util/util');
|
||||
var coinUtil = imports.coinUtil || require('../util');
|
||||
var Key = imports.Key || require('./Key');
|
||||
var Point = imports.Point || require('./Point');
|
||||
var bignum = imports.bignum || require('bignum');
|
||||
var crypto = require('crypto');
|
||||
var networks = require('./networks');
|
||||
var networks = require('../networks');
|
||||
|
||||
var secp256k1_n = new bignum("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141", 16);
|
||||
var secp256k1_Gx = new bignum("79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798", 16);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
var imports = require('soop').imports();
|
||||
|
||||
var util = imports.util || require('./util/util');
|
||||
var util = imports.util || require('../util');
|
||||
var Debug1 = imports.Debug1 || function() {};
|
||||
var Script = imports.Script || require('./Script');
|
||||
var Bignum = imports.Bignum || require('bignum');
|
||||
|
@ -11,7 +11,7 @@ var Transaction = imports.Transaction || require('./Transaction');
|
|||
var TransactionIn = Transaction.In;
|
||||
var TransactionOut = Transaction.Out;
|
||||
var COINBASE_OP = Transaction.COINBASE_OP;
|
||||
var VerificationError = imports.VerificationError || require('./util/error').VerificationError;
|
||||
var VerificationError = imports.VerificationError || require('../util/error').VerificationError;
|
||||
var BlockRules = {
|
||||
maxTimeOffset: 2 * 60 * 60, // How far block timestamps can be into the future
|
||||
largestHash: Bignum(2).pow(256)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
var imports = require('soop').imports();
|
||||
|
||||
var config = imports.config || require('./config');
|
||||
var log = imports.log || require('./util/log');
|
||||
var network = imports.network || require('./networks')[config.network];
|
||||
var config = imports.config || require('../config');
|
||||
var log = imports.log || require('../util/log');
|
||||
var network = imports.network || require('../networks')[config.network];
|
||||
|
||||
var MAX_RECEIVE_BUFFER = 10000000;
|
||||
var PROTOCOL_VERSION = 70000;
|
||||
|
@ -10,12 +10,12 @@ var PROTOCOL_VERSION = 70000;
|
|||
var Binary = imports.Binary || require('binary');
|
||||
var Put = imports.Put || require('bufferput');
|
||||
var Buffers = imports.Buffers || require('buffers');
|
||||
require('./Buffers.monkey').patch(Buffers);
|
||||
require('../patches/Buffers.monkey').patch(Buffers);
|
||||
|
||||
var Block = require('./Block');
|
||||
var Transaction = require('./Transaction');
|
||||
var util = imports.util || require('./util/util');
|
||||
var Parser = imports.Parser || require('./util/BinaryParser');
|
||||
var util = imports.util || require('../util');
|
||||
var Parser = imports.Parser || require('../util/BinaryParser');
|
||||
var buffertools = imports.buffertools || require('buffertools');
|
||||
var doubleSha256 = imports.doubleSha256 || util.twoSha256;
|
||||
var nonce = util.generateNonce();
|
||||
|
|
|
@ -7,7 +7,7 @@ if (process.versions) {
|
|||
module.exports = Key;
|
||||
} else {
|
||||
// pure js version
|
||||
var ECKey = require('./browser/vendor-bundle.js').ECKey;
|
||||
var ECKey = require('../browser/vendor-bundle.js').ECKey;
|
||||
var buffertools = require('buffertools');
|
||||
|
||||
var kSpec = function() {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
var imports = require('soop').imports();
|
||||
var config = imports.config || require('./config');
|
||||
var log = imports.log || require('./util/log');
|
||||
var network = imports.network || require('./networks')[config.network];
|
||||
var config = imports.config || require('../config');
|
||||
var log = imports.log || require('../util/log');
|
||||
var network = imports.network || require('../networks')[config.network];
|
||||
|
||||
var Connection = imports.Connection ||
|
||||
require('soop').load('./Connection', {config: config, network: network}) ||
|
||||
|
|
10
lib/Point.js
10
lib/Point.js
|
@ -7,11 +7,11 @@ var assert = require('assert');
|
|||
|
||||
//browser
|
||||
if (!process.versions) {
|
||||
var ECKey = require('./browser/vendor-bundle.js').ECKey;
|
||||
var ECPointFp = require('./browser/vendor-bundle.js').ECPointFp;
|
||||
var ECFieldElementFp = require('./browser/vendor-bundle.js').ECFieldElementFp;
|
||||
var getSECCurveByName = require('./browser/vendor-bundle.js').getSECCurveByName;
|
||||
var BigInteger = require('./browser/vendor-bundle.js').BigInteger;
|
||||
var ECKey = require('../browser/vendor-bundle.js').ECKey;
|
||||
var ECPointFp = require('../browser/vendor-bundle.js').ECPointFp;
|
||||
var ECFieldElementFp = require('../browser/vendor-bundle.js').ECFieldElementFp;
|
||||
var getSECCurveByName = require('../browser/vendor-bundle.js').getSECCurveByName;
|
||||
var BigInteger = require('../browser/vendor-bundle.js').BigInteger;
|
||||
var should = require('chai').should();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
var imports = require('soop').imports();
|
||||
|
||||
var parent = imports.parent || require('./util/VersionedData');
|
||||
var networks= imports.networks || require('./networks');
|
||||
var parent = imports.parent || require('../util/VersionedData');
|
||||
var networks= imports.networks || require('../networks');
|
||||
|
||||
//compressed is true if public key is compressed; false otherwise
|
||||
function PrivateKey(version, buf, compressed) {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
var imports = require('soop').imports();
|
||||
var http = imports.http || require('http');
|
||||
var https = imports.https || require('https');
|
||||
var log = imports.log || require('./util/log');
|
||||
var log = imports.log || require('../util/log');
|
||||
|
||||
function RpcClient(opts) {
|
||||
opts = opts || {};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
var imports = require('soop').imports();
|
||||
var parent = imports.parent || require('./util/VersionedData');
|
||||
var parent = imports.parent || require('../util/VersionedData');
|
||||
|
||||
function SIN(type, payload) {
|
||||
if (typeof type != 'number') {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
var coinUtil = require('./util/util');
|
||||
var timeUtil = require('./util/time');
|
||||
var coinUtil = require('../util');
|
||||
var timeUtil = require('../util/time');
|
||||
var Key = require('./Key');
|
||||
var SIN = require('./SIN');
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
var imports = require('soop').imports();
|
||||
var config = imports.config || require('./config');
|
||||
var log = imports.log || require('./util/log');
|
||||
var config = imports.config || require('../config');
|
||||
var log = imports.log || require('../util/log');
|
||||
var Opcode = imports.Opcode || require('./Opcode');
|
||||
var buffertools = imports.buffertools || require('buffertools');
|
||||
|
||||
|
@ -9,8 +9,8 @@ for (var i in Opcode.map) {
|
|||
eval(i + " = " + Opcode.map[i] + ";");
|
||||
}
|
||||
|
||||
var util = imports.util || require('./util/util');
|
||||
var Parser = imports.Parser || require('./util/BinaryParser');
|
||||
var util = imports.util || require('../util/util');
|
||||
var Parser = imports.Parser || require('../util/BinaryParser');
|
||||
var Put = imports.Put || require('bufferput');
|
||||
|
||||
var TX_UNKNOWN = 0;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
var imports = require('soop').imports();
|
||||
var config = imports.config || require('./config');
|
||||
var log = imports.log || require('./util/log');
|
||||
var util = imports.util || require('./util/util');
|
||||
var config = imports.config || require('../config');
|
||||
var log = imports.log || require('../util/log');
|
||||
var util = imports.util || require('../util');
|
||||
var Opcode = imports.Opcode || require('./Opcode');
|
||||
var buffertools = imports.buffertools || require('buffertools');
|
||||
var bignum = imports.bignum || require('bignum');
|
||||
var Util = imports.Util || require('./util/util');
|
||||
var Util = imports.Util || require('../util');
|
||||
var Script = require('./Script');
|
||||
var Key = require('./Key');
|
||||
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
var imports = require('soop').imports();
|
||||
var config = imports.config || require('./config');
|
||||
var log = imports.log || require('./util/log');
|
||||
var config = imports.config || require('../config');
|
||||
var log = imports.log || require('../util/log');
|
||||
var Address = imports.Address || require('./Address');
|
||||
var Script = imports.Script || require('./Script');
|
||||
var ScriptInterpreter = imports.ScriptInterpreter || require('./ScriptInterpreter');
|
||||
var util = imports.util || require('./util/util');
|
||||
var util = imports.util || require('../util');
|
||||
var bignum = imports.bignum || require('bignum');
|
||||
var Put = imports.Put || require('bufferput');
|
||||
var Parser = imports.Parser || require('./util/BinaryParser');
|
||||
var Parser = imports.Parser || require('../util/BinaryParser');
|
||||
var Step = imports.Step || require('step');
|
||||
var buffertools = imports.buffertools || require('buffertools');
|
||||
var error = imports.error || require('./util/error');
|
||||
var networks = imports.networks || require('./networks');
|
||||
var error = imports.error || require('../util/error');
|
||||
var networks = imports.networks || require('../networks');
|
||||
var WalletKey = imports.WalletKey || require('./WalletKey');
|
||||
var PrivateKey = imports.PrivateKey || require('./PrivateKey');
|
||||
|
||||
|
|
|
@ -82,10 +82,10 @@
|
|||
var imports = require('soop').imports();
|
||||
var Address = imports.Address || require('./Address');
|
||||
var Script = imports.Script || require('./Script');
|
||||
var util = imports.util || require('./util/util');
|
||||
var util = imports.util || require('../util');
|
||||
var bignum = imports.bignum || require('bignum');
|
||||
var buffertools = imports.buffertools || require('buffertools');
|
||||
var networks = imports.networks || require('./networks');
|
||||
var networks = imports.networks || require('../networks');
|
||||
var WalletKey = imports.WalletKey || require('./WalletKey');
|
||||
var PrivateKey = imports.PrivateKey || require('./PrivateKey');
|
||||
|
||||
|
|
|
@ -3,10 +3,10 @@ var imports = require('soop').imports();
|
|||
var hex = function(hex) {return new Buffer(hex, 'hex');};
|
||||
|
||||
var fs = require('fs');
|
||||
var EncFile = require('./util/EncFile');
|
||||
var EncFile = require('../util/EncFile');
|
||||
var Address = require('./Address');
|
||||
var networks = require('./networks');
|
||||
var util = imports.util || require('./util/util');
|
||||
var networks = require('../networks');
|
||||
var util = imports.util || require('../util');
|
||||
var ENC_METHOD = 'aes-256-cbc';
|
||||
|
||||
var skeleton = {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
var imports = require('soop').imports();
|
||||
|
||||
var coinUtil = require('./util/util');
|
||||
var timeUtil = require('./util/time');
|
||||
var coinUtil = require('../util');
|
||||
var timeUtil = require('../util/time');
|
||||
var Key = require('./Key');
|
||||
var PrivateKey = require('./PrivateKey');
|
||||
var Address = require('./Address');
|
||||
|
|
Loading…
Reference in New Issue