-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementing path finding without Horizon #170
Conversation
9a11615
to
d8f4b43
Compare
11000b5
to
9cf0391
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 change is