mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-20 10:35:50 +00:00
UT: Rework server.js and clean up test output.
This commit is contained in:
14
js/amount.js
14
js/amount.js
@@ -4,14 +4,11 @@
|
||||
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 accounts = {};
|
||||
|
||||
var setAccounts = function (accounts_new) {
|
||||
accounts = accounts_new;
|
||||
};
|
||||
|
||||
var UInt160 = function () {
|
||||
// Internal form:
|
||||
// 0, 1, 'iXXXXX', 20 byte string, or NaN.
|
||||
@@ -44,8 +41,8 @@ UInt160.prototype.copyTo = function(d) {
|
||||
// value = NaN on error.
|
||||
UInt160.prototype.parse_json = function (j) {
|
||||
// Canonicalize and validate
|
||||
if (j in accounts)
|
||||
j = accounts[j].account;
|
||||
if (config.accounts && j in config.accounts)
|
||||
j = config.accounts[j].account;
|
||||
|
||||
switch (j) {
|
||||
case undefined:
|
||||
@@ -445,7 +442,6 @@ Amount.prototype.parse_issuer = function (issuer) {
|
||||
return this;
|
||||
};
|
||||
|
||||
exports.setAccounts = setAccounts;
|
||||
exports.Amount = Amount;
|
||||
exports.Currency = Currency;
|
||||
exports.UInt160 = UInt160;
|
||||
|
||||
Reference in New Issue
Block a user