Browse Source

fix the loading for Key.js

Now, like all other modules loaded in the bitcore object, Key is only required
when it is actually used. All tests pass in node and the browser.
patch-2
Ryan X. Charles 11 years ago
parent
commit
5b67d91f35
  1. 3
      bitcore.js
  2. 2
      browser/browserify.js

3
bitcore.js

@ -30,7 +30,8 @@ requireWhenAccessed('Peer', './Peer');
requireWhenAccessed('Block', './Block');
requireWhenAccessed('ScriptInterpreter', './ScriptInterpreter');
requireWhenAccessed('Bloom', './Bloom');
module.exports.KeyModule = require('./Key');
//module.exports.KeyModule = require('./Key');
requireWhenAccessed('KeyModule', './Key');
requireWhenAccessed('SINKey', './SINKey');
requireWhenAccessed('SIN', './SIN');
requireWhenAccessed('PrivateKey', './PrivateKey');

2
browser/browserify.js

@ -35,6 +35,7 @@ var modules = [
'PeerManager',
'PrivateKey',
'RpcClient',
'Key',
'SIN',
'SINKey',
'Script',
@ -60,7 +61,6 @@ b.require('browserify-buffertools/buffertools.js', {expose:'buffertools'});
b.require('./bitcore', {expose: 'bitcore'});
b.require('buffer', {expose: 'buffer'});
b.require('base58-native');
b.require('./Key.js', {expose: 'KeyModule'});
b.require('./util/log');
b.require('./util/util');
b.require('./util/EncodedData');

Loading…
Cancel
Save