Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #161 from shekenahglory/develop
Browse files Browse the repository at this point in the history
update orderbook module to fix autobridge quality bug
  • Loading branch information
shekenahglory authored Dec 13, 2016
2 parents f5aa19f + b873a6c commit 94e3e10
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions deps/ripple-orderbook.js
Original file line number Diff line number Diff line change
Expand Up @@ -18635,6 +18635,13 @@ var rippleOrderbook =
legTwoPointer++;
}

// calculate quality from leg qualities
var legOneQuality = new IOUValue(legOneOffer.quality);
var legTwoQuality = new IOUValue(legTwoOffer.quality);
autobridgedOffer.quality = legOneQuality.multiply(legTwoQuality).toFixed();
autobridgedOffer.BookDirectory = Utils.convertOfferQualityToHexFromText(autobridgedOffer.quality);
autobridgedOffer.qualityHex = autobridgedOffer.BookDirectory;

offersAutobridged.push(autobridgedOffer);
}

Expand Down Expand Up @@ -18739,7 +18746,6 @@ var rippleOrderbook =
assert(takerPays instanceof IOUValue, 'Autobridged taker pays is invalid');

var autobridgedOffer = {};
var quality = takerPays.divide(takerGets);

autobridgedOffer.TakerGets = {
value: takerGets.toFixed(),
Expand All @@ -18753,16 +18759,10 @@ var rippleOrderbook =
issuer: this._issuerPays
};

autobridgedOffer.quality = quality.toFixed();

autobridgedOffer.taker_gets_funded = autobridgedOffer.TakerGets.value;
autobridgedOffer.taker_pays_funded = autobridgedOffer.TakerPays.value;

autobridgedOffer.autobridged = true;

autobridgedOffer.BookDirectory = Utils.convertOfferQualityToHexFromText(autobridgedOffer.quality);
autobridgedOffer.qualityHex = autobridgedOffer.BookDirectory;

return autobridgedOffer;
}

Expand Down

0 comments on commit 94e3e10

Please sign in to comment.