[Version-unspecific] /thorchain/slips and /thorchain/slip/{asset} endpoints (with example regression test)

[Version-unspecific]

Intended to close #1934 (closed)
'There is no endpoint which allows checking pool slip rollup information'.

Regarding the pool_slip response field and related wording rather than swap_slip,
I note that EventSwap has distinct SwapSlip and PoolSlip fields,
of which
https://gitlab.com/thorchain/thornode/-/blob/v1.130.0/x/thorchain/swap_current.go#L136
if err := keeper.AddToSwapSlip(ctx, evt.Pool, cosmos.NewInt(int64(evt.PoolSlip.Uint64()))); err != nil {
evt.PoolSlip rather than evt.SwapSlip is what is added with AddToSwapSlip
(that is, recording the actual pool slippage rather than the minimum swap slip a swapper experiences in fees,
despite the function name 'AddToSwapSlip' rather than 'AddToPoolSlip').

As always, feedback is welcome!

(In particular, naming changes of fields, functions, or otherwise.)

Currently two fields are rollup and summed_rollup rather than stored_rollup and summed_rollup
due to that summed_rollup is a worse-performance unrequired field only displayed when a single Asset is being queried,
so that rollup can stand alone in the multiple-Assets display without requiring summed_rollup as context.


2024-04-25 update: Regression test now fixed by !3528 (merged) rebase. 🔥

Edited by Multipartite

Merge request reports

Loading