Closed msgmaxim closed 23 hours ago
Attention: Patch coverage is 0.81967%
with 242 lines
in your changes missing coverage. Please review.
Project coverage is 70%. Comparing base (
70f0440
) to head (9d22d36
). Report is 3 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@msgmaxim i've added the capability to query storage directly and reverted the change to cf-pools. Let me know what you think.
@msgmaxim i've added the capability to query storage directly and reverted the change to cf-pools. Let me know what you think.
Looks good. Thanks! Let me know if this can be merged (or happy for you to do so).
Cool - think I'll rebase it (39 commits behind main) and let CI run once more before merging.
I'm asking @j4m1ef0rd to approve this so it can be merged.
Pull Request
Closes: PRO-1543
Checklist
Please conduct a thorough self-review before opening the PR.
Summary
Moved most of the logic from
order_fills
lp-api command undercustom-rpc
so that it can be used/imported in both places.Added the ability to
new_subscription
to pass state from one call of the closure to the next (needed to pass previous pool state in this case, but this could be useful in other subscriptions too).Added new api methods to runtime:
cf_pools
andcf_lp_events
; limited events to LP only to minimise any compatibility issues between runtime and node. The order updates are computed outside of runtime since they require querying (or caching) previous state of the pools storage item (not sure if this can be done from within runtime directly).Tested on localnet with
wscat -c ws://localhost:9944
followed by{"id":1, "jsonrpc":"2.0", "method": "cf_subscribe_lp_order_fills"}
and performing some swaps.