From 5b67d91f3518907065027a94cf4d13a336602317 Mon Sep 17 00:00:00 2001 From: "Ryan X. Charles" Date: Mon, 10 Mar 2014 17:04:23 -0400 Subject: [PATCH] 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. --- bitcore.js | 3 ++- browser/browserify.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bitcore.js b/bitcore.js index 9e755a3..c6db1fb 100644 --- a/bitcore.js +++ b/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'); diff --git a/browser/browserify.js b/browser/browserify.js index d1b627f..87b3415 100644 --- a/browser/browserify.js +++ b/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');