Rework config.js to not be add to web pack.

This commit is contained in:
Arthur Britto
2012-11-07 16:03:39 -08:00
parent c04b94f781
commit b271192547
8 changed files with 24 additions and 12 deletions

View File

@@ -6,13 +6,10 @@ var bn = require('./sjcl/core.js').bn;
var utils = require('./utils.js');
var jsbn = require('./jsbn.js');
// Don't include in browser context.
var config = require('../../test/config.js');
var BigInteger = jsbn.BigInteger;
var nbi = jsbn.nbi;
var alphabets = {
var alphabets = {
'ripple' : "rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz",
'bitcoin' : "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
};
@@ -158,8 +155,8 @@ UInt160.prototype.equals = function(d) {
// value = NaN on error.
UInt160.prototype.parse_json = function (j) {
// Canonicalize and validate
if (config.accounts && j in config.accounts)
j = config.accounts[j].account;
if (exports.config.accounts && j in exports.config.accounts)
j = exports.config.accounts[j].account;
switch (j) {
case undefined:
@@ -603,6 +600,8 @@ exports.Amount = Amount;
exports.Currency = Currency;
exports.UInt160 = UInt160;
exports.config = {};
exports.consts = {
'address_xns' : "rrrrrrrrrrrrrrrrrrrrrhoLvTp",
'address_one' : "rrrrrrrrrrrrrrrrrrrrBZbvji",