Implementing path finding without Horizon#170
Merged
charlie-wasp merged 17 commits intomasterfrom Jun 18, 2019
Merged
Conversation
9a11615 to
d8f4b43
Compare
11000b5 to
9cf0391
Compare
nebolsin
approved these changes
Jun 18, 2019
Member
nebolsin
left a comment
There was a problem hiding this comment.
Added a few tini comments, otherwise
Reviewed 7 of 15 files at r1, 10 of 14 files at r2, 4 of 4 files at r3, 7 of 8 files at r4, 6 of 6 files at r5.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @charlie-wasp)
src/service/dex/offers_listener.ts, line 31 at r5 (raw file):
const offers = await getRepository(Offer).find({ where: pair }); updateOffersGraph(pair.selling, pair.buying, offers); });
Shouldn't we use something like asyncForEach here? I think otherwise subscription callback can complete before those pair updates are still working.
// await asyncForEach(assetPairs, async (pair) => { ... })
export async function asyncForEach<T>(array: T[], mapper: (x: T) => Promise<void>): Promise<void[]> {
return Promise.all(array.map(mapper));
}
src/service/dex/offers_graph.ts, line 123 at r5 (raw file):
// return value; // }); // cloning
✂️
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change is