mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 04:05:52 +00:00
make tests pass
This commit is contained in:
@@ -21,6 +21,7 @@ exports.TransactionQueue = require('./transactionqueue').TransactionQueue;
|
|||||||
exports.convertBase = require('./baseconverter');
|
exports.convertBase = require('./baseconverter');
|
||||||
|
|
||||||
exports._test = {
|
exports._test = {
|
||||||
|
IOUValue: require('./iouvalue').IOUValue,
|
||||||
Log: require('./log'),
|
Log: require('./log'),
|
||||||
PathFind: require('./pathfind').PathFind,
|
PathFind: require('./pathfind').PathFind,
|
||||||
TransactionManager: require('./transactionmanager').TransactionManager,
|
TransactionManager: require('./transactionmanager').TransactionManager,
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ OrderBook.EVENTS = [
|
|||||||
'offer_changed', 'offer_funds_changed'
|
'offer_changed', 'offer_funds_changed'
|
||||||
];
|
];
|
||||||
|
|
||||||
OrderBook.DEFAULT_TRANSFER_RATE = Amount.from_json(1000000000);
|
OrderBook.DEFAULT_TRANSFER_RATE = new IOUValue(1000000000);
|
||||||
|
|
||||||
OrderBook.NOTIFY_TIMEOUT = 100;
|
OrderBook.NOTIFY_TIMEOUT = 100;
|
||||||
|
|
||||||
@@ -424,8 +424,9 @@ OrderBook.prototype.requestTransferRate = function(callback) {
|
|||||||
// When transfer rate is not explicitly set on account, it implies the
|
// When transfer rate is not explicitly set on account, it implies the
|
||||||
// default transfer rate
|
// default transfer rate
|
||||||
self._issuerTransferRate =
|
self._issuerTransferRate =
|
||||||
Amount.from_json(info.account_data.TransferRate ||
|
info.account_data.TransferRate ?
|
||||||
OrderBook.DEFAULT_TRANSFER_RATE);
|
new IOUValue(info.account_data.TransferRate) :
|
||||||
|
OrderBook.DEFAULT_TRANSFER_RATE;
|
||||||
|
|
||||||
callback(null, self._issuerTransferRate);
|
callback(null, self._issuerTransferRate);
|
||||||
}
|
}
|
||||||
@@ -544,16 +545,10 @@ OrderBook.prototype.setOwnerFunds = function(account, fundedAmount) {
|
|||||||
|
|
||||||
OrderBook.prototype.applyTransferRate = function(balance) {
|
OrderBook.prototype.applyTransferRate = function(balance) {
|
||||||
assert(!isNaN(balance), 'Balance is invalid');
|
assert(!isNaN(balance), 'Balance is invalid');
|
||||||
assert(this._issuerTransferRate.is_valid(), 'Transfer rate is invalid');
|
|
||||||
|
|
||||||
const adjustedBalance = (new IOUValue(balance))
|
const adjustedBalance = (new IOUValue(balance))
|
||||||
.divide(new IOUValue(this._issuerTransferRate))
|
|
||||||
.multiply(new IOUValue(OrderBook.DEFAULT_TRANSFER_RATE)).toString();
|
|
||||||
const adjustedBalance = OrderBookUtils.normalizeAmount(balance)
|
|
||||||
.divide(this._issuerTransferRate)
|
.divide(this._issuerTransferRate)
|
||||||
.multiply(OrderBook.DEFAULT_TRANSFER_RATE)
|
.multiply(OrderBook.DEFAULT_TRANSFER_RATE).toString();
|
||||||
.to_json()
|
|
||||||
.value;
|
|
||||||
|
|
||||||
return adjustedBalance;
|
return adjustedBalance;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -140,6 +140,24 @@ OrderBookUtils.convertOfferQualityToHex = function(quality) {
|
|||||||
return so.to_hex();
|
return so.to_hex();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Formats an offer quality amount to a hex that can be parsed by
|
||||||
|
* Amount.parse_quality
|
||||||
|
*
|
||||||
|
* @param {String} quality
|
||||||
|
*
|
||||||
|
* @return {String}
|
||||||
|
*/
|
||||||
|
|
||||||
|
OrderBookUtils.convertOfferQualityToHexFromText = function(quality) {
|
||||||
|
|
||||||
|
const so = new SerializedObject();
|
||||||
|
Types.Quality.serialize(so, quality);
|
||||||
|
|
||||||
|
return so.to_hex();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|||||||
6
test/fixtures/orderbook.js
vendored
6
test/fixtures/orderbook.js
vendored
@@ -8,6 +8,7 @@ const Meta = require('ripple-lib').Meta;
|
|||||||
const Amount = require('ripple-lib').Amount;
|
const Amount = require('ripple-lib').Amount;
|
||||||
const SerializedObject = require('ripple-lib').SerializedObject;
|
const SerializedObject = require('ripple-lib').SerializedObject;
|
||||||
const Types = require('ripple-lib').types;
|
const Types = require('ripple-lib').types;
|
||||||
|
const IOUValue = require('ripple-lib')._test.IOUValue;
|
||||||
|
|
||||||
module.exports.FIAT_BALANCE = '10';
|
module.exports.FIAT_BALANCE = '10';
|
||||||
module.exports.NATIVE_BALANCE = '55';
|
module.exports.NATIVE_BALANCE = '55';
|
||||||
@@ -812,7 +813,6 @@ module.exports.transactionWithInvalidAccountRoot = function(options) {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const IOU_SUFFIX = '/000/rrrrrrrrrrrrrrrrrrrrrhoLvTp';
|
|
||||||
|
|
||||||
module.exports.transactionWithCreatedOffer = function(options) {
|
module.exports.transactionWithCreatedOffer = function(options) {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
@@ -821,8 +821,8 @@ module.exports.transactionWithCreatedOffer = function(options) {
|
|||||||
amount: '1.9951'
|
amount: '1.9951'
|
||||||
});
|
});
|
||||||
|
|
||||||
const takerGets = Amount.from_json(options.amount + IOU_SUFFIX);
|
const takerGets = new IOUValue(options.amount);
|
||||||
const takerPays = Amount.from_json(module.exports.TAKER_PAYS + IOU_SUFFIX);
|
const takerPays = new IOUValue(module.exports.TAKER_PAYS);
|
||||||
const quality = takerPays.divide(takerGets);
|
const quality = takerPays.divide(takerGets);
|
||||||
|
|
||||||
const so = new SerializedObject();
|
const so = new SerializedObject();
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ const Currency = require('ripple-lib').Currency;
|
|||||||
const Amount = require('ripple-lib').Amount;
|
const Amount = require('ripple-lib').Amount;
|
||||||
const addresses = require('./fixtures/addresses');
|
const addresses = require('./fixtures/addresses');
|
||||||
const fixtures = require('./fixtures/orderbook');
|
const fixtures = require('./fixtures/orderbook');
|
||||||
|
const IOUValue = require('ripple-lib')._test.IOUValue;
|
||||||
|
|
||||||
describe('OrderBook Autobridging', function() {
|
describe('OrderBook Autobridging', function() {
|
||||||
this.timeout(0);
|
this.timeout(0);
|
||||||
@@ -45,9 +46,9 @@ describe('OrderBook Autobridging', function() {
|
|||||||
issuer_pays: addresses.ISSUER
|
issuer_pays: addresses.ISSUER
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book._legOneBook._issuerTransferRate = Amount.from_json(1000000000);
|
book._legOneBook._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book._legTwoBook._issuerTransferRate = Amount.from_json(1000000000);
|
book._legTwoBook._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
const legOneOffers = _.cloneDeep(fixtures.LEG_ONE_OFFERS.slice(0, 1));
|
const legOneOffers = _.cloneDeep(fixtures.LEG_ONE_OFFERS.slice(0, 1));
|
||||||
const legTwoOffers = _.cloneDeep(fixtures.LEG_TWO_OFFERS.slice(0, 1));
|
const legTwoOffers = _.cloneDeep(fixtures.LEG_TWO_OFFERS.slice(0, 1));
|
||||||
@@ -77,9 +78,9 @@ describe('OrderBook Autobridging', function() {
|
|||||||
issuer_pays: addresses.ISSUER
|
issuer_pays: addresses.ISSUER
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book._legOneBook._issuerTransferRate = Amount.from_json(1000000000);
|
book._legOneBook._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book._legTwoBook._issuerTransferRate = Amount.from_json(1000000000);
|
book._legTwoBook._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
const legOneOffers = _.cloneDeep(fixtures.LEG_ONE_OFFERS.slice(0, 1));
|
const legOneOffers = _.cloneDeep(fixtures.LEG_ONE_OFFERS.slice(0, 1));
|
||||||
const legTwoOffers = _.cloneDeep(fixtures.LEG_TWO_OFFERS.slice(0, 1));
|
const legTwoOffers = _.cloneDeep(fixtures.LEG_TWO_OFFERS.slice(0, 1));
|
||||||
@@ -108,9 +109,9 @@ describe('OrderBook Autobridging', function() {
|
|||||||
issuer_pays: addresses.ISSUER
|
issuer_pays: addresses.ISSUER
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book._legOneBook._issuerTransferRate = Amount.from_json(1000000000);
|
book._legOneBook._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book._legTwoBook._issuerTransferRate = Amount.from_json(1000000000);
|
book._legTwoBook._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
const legOneOffers = _.cloneDeep(fixtures.LEG_ONE_OFFERS.slice(0, 1));
|
const legOneOffers = _.cloneDeep(fixtures.LEG_ONE_OFFERS.slice(0, 1));
|
||||||
const legTwoOffers = _.cloneDeep(fixtures.LEG_TWO_OFFERS.slice(0, 1));
|
const legTwoOffers = _.cloneDeep(fixtures.LEG_TWO_OFFERS.slice(0, 1));
|
||||||
@@ -139,9 +140,9 @@ describe('OrderBook Autobridging', function() {
|
|||||||
issuer_pays: addresses.ISSUER
|
issuer_pays: addresses.ISSUER
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book._legOneBook._issuerTransferRate = Amount.from_json(1000000000);
|
book._legOneBook._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book._legTwoBook._issuerTransferRate = Amount.from_json(1002000000);
|
book._legTwoBook._issuerTransferRate = new IOUValue(1002000000);
|
||||||
|
|
||||||
const legOneOffers = _.cloneDeep(fixtures.LEG_ONE_OFFERS.slice(0, 1));
|
const legOneOffers = _.cloneDeep(fixtures.LEG_ONE_OFFERS.slice(0, 1));
|
||||||
const legTwoOffers = _.cloneDeep(fixtures.LEG_TWO_OFFERS.slice(0, 1));
|
const legTwoOffers = _.cloneDeep(fixtures.LEG_TWO_OFFERS.slice(0, 1));
|
||||||
@@ -168,9 +169,9 @@ describe('OrderBook Autobridging', function() {
|
|||||||
issuer_pays: addresses.ISSUER
|
issuer_pays: addresses.ISSUER
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book._legOneBook._issuerTransferRate = Amount.from_json(1000000000);
|
book._legOneBook._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book._legTwoBook._issuerTransferRate = Amount.from_json(1000000000);
|
book._legTwoBook._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
const legOneOffers = _.cloneDeep(fixtures.LEG_ONE_OFFERS.slice(0, 1));
|
const legOneOffers = _.cloneDeep(fixtures.LEG_ONE_OFFERS.slice(0, 1));
|
||||||
const legTwoOffers = _.cloneDeep(fixtures.LEG_TWO_OFFERS.slice(0, 1));
|
const legTwoOffers = _.cloneDeep(fixtures.LEG_TWO_OFFERS.slice(0, 1));
|
||||||
@@ -203,9 +204,9 @@ describe('OrderBook Autobridging', function() {
|
|||||||
issuer_pays: addresses.ISSUER
|
issuer_pays: addresses.ISSUER
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book._legOneBook._issuerTransferRate = Amount.from_json(1000000000);
|
book._legOneBook._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book._legTwoBook._issuerTransferRate = Amount.from_json(1000000000);
|
book._legTwoBook._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
const legOneOffers = _.cloneDeep(fixtures.LEG_ONE_OFFERS.slice(0, 1));
|
const legOneOffers = _.cloneDeep(fixtures.LEG_ONE_OFFERS.slice(0, 1));
|
||||||
const legTwoOffers = _.cloneDeep(fixtures.LEG_TWO_OFFERS.slice(0, 1));
|
const legTwoOffers = _.cloneDeep(fixtures.LEG_TWO_OFFERS.slice(0, 1));
|
||||||
@@ -236,9 +237,9 @@ describe('OrderBook Autobridging', function() {
|
|||||||
issuer_pays: addresses.ISSUER
|
issuer_pays: addresses.ISSUER
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book._legOneBook._issuerTransferRate = Amount.from_json(1000000000);
|
book._legOneBook._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book._legTwoBook._issuerTransferRate = Amount.from_json(1000000000);
|
book._legTwoBook._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
const legOneOffers = _.cloneDeep(fixtures.LEG_ONE_OFFERS.slice(0, 1));
|
const legOneOffers = _.cloneDeep(fixtures.LEG_ONE_OFFERS.slice(0, 1));
|
||||||
const legTwoOffers = _.cloneDeep(fixtures.LEG_TWO_OFFERS.slice(0, 1));
|
const legTwoOffers = _.cloneDeep(fixtures.LEG_TWO_OFFERS.slice(0, 1));
|
||||||
@@ -272,9 +273,9 @@ describe('OrderBook Autobridging', function() {
|
|||||||
issuer_pays: addresses.ISSUER
|
issuer_pays: addresses.ISSUER
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book._legOneBook._issuerTransferRate = Amount.from_json(1000000000);
|
book._legOneBook._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book._legTwoBook._issuerTransferRate = Amount.from_json(1000000000);
|
book._legTwoBook._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
const legOneOffers = _.cloneDeep(fixtures.LEG_ONE_OFFERS.slice(0, 1));
|
const legOneOffers = _.cloneDeep(fixtures.LEG_ONE_OFFERS.slice(0, 1));
|
||||||
const legTwoOffers = _.cloneDeep(fixtures.LEG_TWO_OFFERS.slice(0, 2));
|
const legTwoOffers = _.cloneDeep(fixtures.LEG_TWO_OFFERS.slice(0, 2));
|
||||||
@@ -306,9 +307,9 @@ describe('OrderBook Autobridging', function() {
|
|||||||
issuer_pays: addresses.ISSUER
|
issuer_pays: addresses.ISSUER
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book._legOneBook._issuerTransferRate = Amount.from_json(1000000000);
|
book._legOneBook._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book._legTwoBook._issuerTransferRate = Amount.from_json(1000000000);
|
book._legTwoBook._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
const legOneOffers = _.cloneDeep(fixtures.LEG_ONE_OFFERS.slice(0, 2));
|
const legOneOffers = _.cloneDeep(fixtures.LEG_ONE_OFFERS.slice(0, 2));
|
||||||
const legTwoOffers = _.cloneDeep(fixtures.LEG_TWO_OFFERS.slice(0, 1));
|
const legTwoOffers = _.cloneDeep(fixtures.LEG_TWO_OFFERS.slice(0, 1));
|
||||||
@@ -344,9 +345,9 @@ describe('OrderBook Autobridging', function() {
|
|||||||
issuer_pays: addresses.ISSUER
|
issuer_pays: addresses.ISSUER
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book._legOneBook._issuerTransferRate = Amount.from_json(1000000000);
|
book._legOneBook._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book._legTwoBook._issuerTransferRate = Amount.from_json(1002000000);
|
book._legTwoBook._issuerTransferRate = new IOUValue(1002000000);
|
||||||
|
|
||||||
const legOneOffers = _.cloneDeep(fixtures.LEG_ONE_OFFERS.slice(0, 1));
|
const legOneOffers = _.cloneDeep(fixtures.LEG_ONE_OFFERS.slice(0, 1));
|
||||||
const legTwoOffers = _.cloneDeep(fixtures.LEG_TWO_OFFERS.slice(0, 2));
|
const legTwoOffers = _.cloneDeep(fixtures.LEG_TWO_OFFERS.slice(0, 2));
|
||||||
@@ -383,9 +384,9 @@ describe('OrderBook Autobridging', function() {
|
|||||||
issuer_pays: addresses.ISSUER
|
issuer_pays: addresses.ISSUER
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book._legOneBook._issuerTransferRate = Amount.from_json(1000000000);
|
book._legOneBook._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book._legTwoBook._issuerTransferRate = Amount.from_json(1002000000);
|
book._legTwoBook._issuerTransferRate = new IOUValue(1002000000);
|
||||||
|
|
||||||
const legOneOffers = _.cloneDeep(fixtures.LEG_ONE_OFFERS.slice(0, 1));
|
const legOneOffers = _.cloneDeep(fixtures.LEG_ONE_OFFERS.slice(0, 1));
|
||||||
const legTwoOffers = _.cloneDeep(fixtures.LEG_TWO_OFFERS.slice(0, 2));
|
const legTwoOffers = _.cloneDeep(fixtures.LEG_TWO_OFFERS.slice(0, 2));
|
||||||
@@ -423,9 +424,9 @@ describe('OrderBook Autobridging', function() {
|
|||||||
issuer_pays: addresses.ISSUER
|
issuer_pays: addresses.ISSUER
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book._legOneBook._issuerTransferRate = Amount.from_json(1000000000);
|
book._legOneBook._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book._legTwoBook._issuerTransferRate = Amount.from_json(1000000000);
|
book._legTwoBook._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
book._legOneBook.setOffers([
|
book._legOneBook.setOffers([
|
||||||
{
|
{
|
||||||
@@ -476,9 +477,9 @@ describe('OrderBook Autobridging', function() {
|
|||||||
issuer_pays: addresses.ISSUER
|
issuer_pays: addresses.ISSUER
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book._legOneBook._issuerTransferRate = Amount.from_json(1000000000);
|
book._legOneBook._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book._legTwoBook._issuerTransferRate = Amount.from_json(1000000000);
|
book._legTwoBook._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
book._legOneBook.setOffers([
|
book._legOneBook.setOffers([
|
||||||
{
|
{
|
||||||
@@ -562,9 +563,9 @@ describe('OrderBook Autobridging', function() {
|
|||||||
issuer_pays: addresses.ISSUER
|
issuer_pays: addresses.ISSUER
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book._legOneBook._issuerTransferRate = Amount.from_json(1000000000);
|
book._legOneBook._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book._legTwoBook._issuerTransferRate = Amount.from_json(1000000000);
|
book._legTwoBook._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
book._legOneBook.setOffers([
|
book._legOneBook.setOffers([
|
||||||
{
|
{
|
||||||
@@ -648,9 +649,9 @@ describe('OrderBook Autobridging', function() {
|
|||||||
issuer_pays: addresses.ISSUER
|
issuer_pays: addresses.ISSUER
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book._legOneBook._issuerTransferRate = Amount.from_json(1000000000);
|
book._legOneBook._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book._legTwoBook._issuerTransferRate = Amount.from_json(1000000000);
|
book._legTwoBook._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
book._legOneBook.setOffers([
|
book._legOneBook.setOffers([
|
||||||
{
|
{
|
||||||
@@ -750,9 +751,9 @@ describe('OrderBook Autobridging', function() {
|
|||||||
issuer_pays: addresses.ISSUER
|
issuer_pays: addresses.ISSUER
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book._legOneBook._issuerTransferRate = Amount.from_json(1000000000);
|
book._legOneBook._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book._legTwoBook._issuerTransferRate = Amount.from_json(1000000000);
|
book._legTwoBook._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
book._legOneBook.setOffers([
|
book._legOneBook.setOffers([
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ const Amount = require('ripple-lib').Amount;
|
|||||||
const Meta = require('ripple-lib').Meta;
|
const Meta = require('ripple-lib').Meta;
|
||||||
const addresses = require('./fixtures/addresses');
|
const addresses = require('./fixtures/addresses');
|
||||||
const fixtures = require('./fixtures/orderbook');
|
const fixtures = require('./fixtures/orderbook');
|
||||||
|
const IOUValue = require('ripple-lib')._test.IOUValue;
|
||||||
|
|
||||||
describe('OrderBook', function() {
|
describe('OrderBook', function() {
|
||||||
this.timeout(0);
|
this.timeout(0);
|
||||||
@@ -160,7 +161,7 @@ describe('OrderBook', function() {
|
|||||||
currency_pays: 'BTC'
|
currency_pays: 'BTC'
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
book.setOwnerFunds(addresses.ACCOUNT, '1');
|
book.setOwnerFunds(addresses.ACCOUNT, '1');
|
||||||
|
|
||||||
assert.strictEqual(book.getOwnerFunds(addresses.ACCOUNT).to_text(), '1');
|
assert.strictEqual(book.getOwnerFunds(addresses.ACCOUNT).to_text(), '1');
|
||||||
@@ -173,7 +174,7 @@ describe('OrderBook', function() {
|
|||||||
currency_pays: 'BTC'
|
currency_pays: 'BTC'
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1002000000);
|
book._issuerTransferRate = new IOUValue(1002000000);
|
||||||
book.setOwnerFunds(addresses.ACCOUNT, '1');
|
book.setOwnerFunds(addresses.ACCOUNT, '1');
|
||||||
|
|
||||||
assert.strictEqual(book._ownerFundsUnadjusted[addresses.ACCOUNT], '1');
|
assert.strictEqual(book._ownerFundsUnadjusted[addresses.ACCOUNT], '1');
|
||||||
@@ -228,21 +229,6 @@ describe('OrderBook', function() {
|
|||||||
assert(!book.hasOwnerFunds(addresses.ACCOUNT));
|
assert(!book.hasOwnerFunds(addresses.ACCOUNT));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Delete owner funds', function() {
|
|
||||||
const book = createRemote().createOrderBook({
|
|
||||||
currency_gets: 'BTC',
|
|
||||||
issuer_gets: addresses.ISSUER,
|
|
||||||
currency_pays: 'XRP'
|
|
||||||
});
|
|
||||||
|
|
||||||
book._ownerFunds[addresses.ACCOUNT] = '1';
|
|
||||||
assert(book.hasOwnerFunds(addresses.ACCOUNT));
|
|
||||||
|
|
||||||
assert.throws(function() {
|
|
||||||
book.deleteOwnerFunds('0rrrrrrrrrrrrrrrrrrrrBZbvji');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('Increment owner offer count', function() {
|
it('Increment owner offer count', function() {
|
||||||
const book = createRemote().createOrderBook({
|
const book = createRemote().createOrderBook({
|
||||||
currency_gets: 'BTC',
|
currency_gets: 'BTC',
|
||||||
@@ -379,7 +365,7 @@ describe('OrderBook', function() {
|
|||||||
currency_pays: 'XRP'
|
currency_pays: 'XRP'
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1002000000);
|
book._issuerTransferRate = new IOUValue(1002000000);
|
||||||
|
|
||||||
assert.strictEqual(book.applyTransferRate('1'), '0.9980039920159681');
|
assert.strictEqual(book.applyTransferRate('1'), '0.9980039920159681');
|
||||||
});
|
});
|
||||||
@@ -391,7 +377,7 @@ describe('OrderBook', function() {
|
|||||||
currency_pays: 'BTC'
|
currency_pays: 'BTC'
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
assert.strictEqual(book.applyTransferRate('0.9980039920159681'), '0.9980039920159681');
|
assert.strictEqual(book.applyTransferRate('0.9980039920159681'), '0.9980039920159681');
|
||||||
});
|
});
|
||||||
@@ -437,14 +423,14 @@ describe('OrderBook', function() {
|
|||||||
|
|
||||||
request.emit('success', {
|
request.emit('success', {
|
||||||
account_data: {
|
account_data: {
|
||||||
TransferRate: Amount.from_json(1002000000)
|
TransferRate: 1002000000
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
book.requestTransferRate(function(err, rate) {
|
book.requestTransferRate(function(err, rate) {
|
||||||
assert.ifError(err);
|
assert.ifError(err);
|
||||||
assert(rate.equals(1002000000));
|
assert(rate.equals(new IOUValue(1002000000)));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -471,7 +457,7 @@ describe('OrderBook', function() {
|
|||||||
|
|
||||||
book.requestTransferRate(function(err, rate) {
|
book.requestTransferRate(function(err, rate) {
|
||||||
assert.ifError(err);
|
assert.ifError(err);
|
||||||
assert(rate.equals(1000000000));
|
assert(rate.equals(new IOUValue(1000000000)));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -483,7 +469,7 @@ describe('OrderBook', function() {
|
|||||||
currency_pays: 'XRP'
|
currency_pays: 'XRP'
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1002000000);
|
book._issuerTransferRate = new IOUValue(1002000000);
|
||||||
|
|
||||||
remote.request = function() {
|
remote.request = function() {
|
||||||
assert(false);
|
assert(false);
|
||||||
@@ -491,7 +477,7 @@ describe('OrderBook', function() {
|
|||||||
|
|
||||||
book.requestTransferRate(function(err, rate) {
|
book.requestTransferRate(function(err, rate) {
|
||||||
assert.ifError(err);
|
assert.ifError(err);
|
||||||
assert(rate.equals(1002000000));
|
assert(rate.equals(new IOUValue(1002000000)));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -509,8 +495,8 @@ describe('OrderBook', function() {
|
|||||||
|
|
||||||
book.requestTransferRate(function(err, rate) {
|
book.requestTransferRate(function(err, rate) {
|
||||||
assert.ifError(err);
|
assert.ifError(err);
|
||||||
assert(rate.equals(1000000000));
|
assert(rate.equals(new IOUValue(1000000000)));
|
||||||
assert(book._issuerTransferRate.equals(1000000000));
|
assert(book._issuerTransferRate.equals(new IOUValue(1000000000)));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -522,7 +508,7 @@ describe('OrderBook', function() {
|
|||||||
issuer_gets: addresses.ISSUER
|
issuer_gets: addresses.ISSUER
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
const offer = {
|
const offer = {
|
||||||
Account: addresses.ACCOUNT,
|
Account: addresses.ACCOUNT,
|
||||||
@@ -558,7 +544,7 @@ describe('OrderBook', function() {
|
|||||||
issuer_gets: addresses.ISSUER
|
issuer_gets: addresses.ISSUER
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
const offer = {
|
const offer = {
|
||||||
Account: addresses.ACCOUNT,
|
Account: addresses.ACCOUNT,
|
||||||
@@ -596,7 +582,7 @@ describe('OrderBook', function() {
|
|||||||
currency_pays: 'BTC'
|
currency_pays: 'BTC'
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
const offer = {
|
const offer = {
|
||||||
Account: addresses.ACCOUNT,
|
Account: addresses.ACCOUNT,
|
||||||
@@ -632,7 +618,7 @@ describe('OrderBook', function() {
|
|||||||
currency_pays: 'BTC'
|
currency_pays: 'BTC'
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
const offer = {
|
const offer = {
|
||||||
Account: addresses.ACCOUNT,
|
Account: addresses.ACCOUNT,
|
||||||
@@ -670,7 +656,7 @@ describe('OrderBook', function() {
|
|||||||
currency_pays: 'BTC'
|
currency_pays: 'BTC'
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
const offer = {
|
const offer = {
|
||||||
Account: addresses.ACCOUNT,
|
Account: addresses.ACCOUNT,
|
||||||
@@ -1101,7 +1087,7 @@ describe('OrderBook', function() {
|
|||||||
currency_pays: 'XRP'
|
currency_pays: 'XRP'
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
book._offers = fixtures.fiatOffers();
|
book._offers = fixtures.fiatOffers();
|
||||||
|
|
||||||
@@ -1153,7 +1139,7 @@ describe('OrderBook', function() {
|
|||||||
currency_pays: 'XRP'
|
currency_pays: 'XRP'
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
book.setOffers(fixtures.fiatOffers({
|
book.setOffers(fixtures.fiatOffers({
|
||||||
account_funds: '19'
|
account_funds: '19'
|
||||||
@@ -1192,7 +1178,7 @@ describe('OrderBook', function() {
|
|||||||
currency_pays: 'XRP'
|
currency_pays: 'XRP'
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1002000000);
|
book._issuerTransferRate = new IOUValue(1002000000);
|
||||||
|
|
||||||
book._offers = fixtures.fiatOffers();
|
book._offers = fixtures.fiatOffers();
|
||||||
|
|
||||||
@@ -1218,7 +1204,7 @@ describe('OrderBook', function() {
|
|||||||
currency_pays: 'XRP'
|
currency_pays: 'XRP'
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1002000000);
|
book._issuerTransferRate = new IOUValue(1002000000);
|
||||||
|
|
||||||
book._ownerFunds[addresses.ACCOUNT] = '100';
|
book._ownerFunds[addresses.ACCOUNT] = '100';
|
||||||
book._offers = fixtures.fiatOffers();
|
book._offers = fixtures.fiatOffers();
|
||||||
@@ -1362,7 +1348,7 @@ describe('OrderBook', function() {
|
|||||||
|
|
||||||
request.emit('success', fixtures.accountInfoResponse());
|
request.emit('success', fixtures.accountInfoResponse());
|
||||||
|
|
||||||
assert(book._issuerTransferRate.equals(fixtures.TRANSFER_RATE));
|
assert(book._issuerTransferRate.equals(new IOUValue(fixtures.TRANSFER_RATE)));
|
||||||
done();
|
done();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1379,7 +1365,7 @@ describe('OrderBook', function() {
|
|||||||
currency_pays: 'XRP'
|
currency_pays: 'XRP'
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1002000000);
|
book._issuerTransferRate = new IOUValue(1002000000);
|
||||||
|
|
||||||
const offers = fixtures.bookOffersResponse().offers;
|
const offers = fixtures.bookOffersResponse().offers;
|
||||||
|
|
||||||
@@ -1412,7 +1398,7 @@ describe('OrderBook', function() {
|
|||||||
currency_pays: 'XRP'
|
currency_pays: 'XRP'
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1002000000);
|
book._issuerTransferRate = new IOUValue(1002000000);
|
||||||
|
|
||||||
const offers = fixtures.bookOffersResponse({
|
const offers = fixtures.bookOffersResponse({
|
||||||
account_funds: '233.13532'
|
account_funds: '233.13532'
|
||||||
@@ -1485,7 +1471,7 @@ describe('OrderBook', function() {
|
|||||||
currency_pays: 'XRP'
|
currency_pays: 'XRP'
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1002000000);
|
book._issuerTransferRate = new IOUValue(1002000000);
|
||||||
|
|
||||||
const offers = fixtures.bookOffersResponse().offers;
|
const offers = fixtures.bookOffersResponse().offers;
|
||||||
|
|
||||||
@@ -1519,7 +1505,7 @@ describe('OrderBook', function() {
|
|||||||
currency_pays: 'XRP'
|
currency_pays: 'XRP'
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1002000000);
|
book._issuerTransferRate = new IOUValue(1002000000);
|
||||||
|
|
||||||
const offers = fixtures.DECIMAL_TAKER_PAYS_FUNDED_OFFERS;
|
const offers = fixtures.DECIMAL_TAKER_PAYS_FUNDED_OFFERS;
|
||||||
|
|
||||||
@@ -1540,7 +1526,7 @@ describe('OrderBook', function() {
|
|||||||
currency_pays: 'XRP'
|
currency_pays: 'XRP'
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1002000000);
|
book._issuerTransferRate = new IOUValue(1002000000);
|
||||||
book._subscribed = book._synced = true;
|
book._subscribed = book._synced = true;
|
||||||
|
|
||||||
const message = fixtures.transactionWithCreatedOffer();
|
const message = fixtures.transactionWithCreatedOffer();
|
||||||
@@ -1562,7 +1548,7 @@ describe('OrderBook', function() {
|
|||||||
currency_pays: 'XRP'
|
currency_pays: 'XRP'
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1002000000);
|
book._issuerTransferRate = new IOUValue(1002000000);
|
||||||
book._subscribed = book._synced = true;
|
book._subscribed = book._synced = true;
|
||||||
|
|
||||||
const offer = fixtures.transactionWithCreatedOffer();
|
const offer = fixtures.transactionWithCreatedOffer();
|
||||||
@@ -1612,7 +1598,7 @@ describe('OrderBook', function() {
|
|||||||
numOfferAddedEvents += 1;
|
numOfferAddedEvents += 1;
|
||||||
});
|
});
|
||||||
|
|
||||||
book._issuerTransferRate = Amount.from_json(1002000000);
|
book._issuerTransferRate = new IOUValue(1002000000);
|
||||||
book._subscribed = book._synced = true;
|
book._subscribed = book._synced = true;
|
||||||
|
|
||||||
const offer = fixtures.transactionWithCreatedOffer();
|
const offer = fixtures.transactionWithCreatedOffer();
|
||||||
@@ -1641,7 +1627,7 @@ describe('OrderBook', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
book._subscribed = true;
|
book._subscribed = true;
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
book.setOffers(fixtures.fiatOffers());
|
book.setOffers(fixtures.fiatOffers());
|
||||||
|
|
||||||
@@ -1664,7 +1650,7 @@ describe('OrderBook', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
book._subscribed = true;
|
book._subscribed = true;
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
book.setOffers(fixtures.fiatOffers().slice(0, 1));
|
book.setOffers(fixtures.fiatOffers().slice(0, 1));
|
||||||
|
|
||||||
@@ -1706,7 +1692,7 @@ describe('OrderBook', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
book._subscribed = true;
|
book._subscribed = true;
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
book.setOffers(fixtures.fiatOffers());
|
book.setOffers(fixtures.fiatOffers());
|
||||||
|
|
||||||
@@ -1746,7 +1732,7 @@ describe('OrderBook', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
book._subscribed = true;
|
book._subscribed = true;
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
book.setOffers(fixtures.fiatOffers());
|
book.setOffers(fixtures.fiatOffers());
|
||||||
|
|
||||||
@@ -1765,7 +1751,7 @@ describe('OrderBook', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
book._subscribed = true;
|
book._subscribed = true;
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
book.setOffers(fixtures.fiatOffers());
|
book.setOffers(fixtures.fiatOffers());
|
||||||
|
|
||||||
@@ -1790,7 +1776,7 @@ describe('OrderBook', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
book._subscribed = true;
|
book._subscribed = true;
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
book.setOffers(fixtures.fiatOffers().slice(0, 1));
|
book.setOffers(fixtures.fiatOffers().slice(0, 1));
|
||||||
|
|
||||||
@@ -1814,7 +1800,7 @@ describe('OrderBook', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
book._subscribed = true;
|
book._subscribed = true;
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
book.setOffers(fixtures.fiatOffers());
|
book.setOffers(fixtures.fiatOffers());
|
||||||
|
|
||||||
@@ -1865,7 +1851,7 @@ describe('OrderBook', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
book._subscribed = true;
|
book._subscribed = true;
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
book.setOffers(fixtures.fiatOffers());
|
book.setOffers(fixtures.fiatOffers());
|
||||||
|
|
||||||
@@ -1905,7 +1891,7 @@ describe('OrderBook', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
book._subscribed = true;
|
book._subscribed = true;
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
book.setOffers(fixtures.fiatOffers());
|
book.setOffers(fixtures.fiatOffers());
|
||||||
|
|
||||||
@@ -1937,7 +1923,7 @@ describe('OrderBook', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
book._subscribed = true;
|
book._subscribed = true;
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
book.setOffers(fixtures.fiatOffers());
|
book.setOffers(fixtures.fiatOffers());
|
||||||
|
|
||||||
@@ -1976,7 +1962,7 @@ describe('OrderBook', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
book._subscribed = true;
|
book._subscribed = true;
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
book.setOffers(fixtures.fiatOffers());
|
book.setOffers(fixtures.fiatOffers());
|
||||||
|
|
||||||
@@ -2046,7 +2032,7 @@ describe('OrderBook', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
book._subscribed = true;
|
book._subscribed = true;
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
book.setOffers(fixtures.fiatOffers({
|
book.setOffers(fixtures.fiatOffers({
|
||||||
account_funds: '20'
|
account_funds: '20'
|
||||||
@@ -2073,7 +2059,7 @@ describe('OrderBook', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
book._subscribed = true;
|
book._subscribed = true;
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
book.setOffers(fixtures.fiatOffers({
|
book.setOffers(fixtures.fiatOffers({
|
||||||
account_funds: '4.5'
|
account_funds: '4.5'
|
||||||
@@ -2102,7 +2088,7 @@ describe('OrderBook', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
book._subscribed = true;
|
book._subscribed = true;
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
book.setOffers(fixtures.QUALITY_OFFERS);
|
book.setOffers(fixtures.QUALITY_OFFERS);
|
||||||
|
|
||||||
@@ -2126,7 +2112,7 @@ describe('OrderBook', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
book._subscribed = true;
|
book._subscribed = true;
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
book.setOffers(fixtures.fiatOffers());
|
book.setOffers(fixtures.fiatOffers());
|
||||||
|
|
||||||
@@ -2161,7 +2147,7 @@ describe('OrderBook', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
book._subscribed = true;
|
book._subscribed = true;
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
book.setOffers(fixtures.fiatOffers({
|
book.setOffers(fixtures.fiatOffers({
|
||||||
account_funds: '25'
|
account_funds: '25'
|
||||||
@@ -2198,7 +2184,7 @@ describe('OrderBook', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
book._subscribed = true;
|
book._subscribed = true;
|
||||||
book._issuerTransferRate = Amount.from_json(1000000000);
|
book._issuerTransferRate = new IOUValue(1000000000);
|
||||||
|
|
||||||
book.setOffers(fixtures.fiatOffers({
|
book.setOffers(fixtures.fiatOffers({
|
||||||
account_funds: '30'
|
account_funds: '30'
|
||||||
|
|||||||
Reference in New Issue
Block a user