2
0
mirror of https://github.com/lightninglabs/loop synced 2024-11-09 19:10:47 +00:00
Commit Graph

21 Commits

Author SHA1 Message Date
longxiangqiao
273422eef7 chore: fix some comments for struct field
Signed-off-by: longxiangqiao <longxiangqiao@qq.com>
2024-07-13 13:50:12 +08:00
Boris Nagaev
3be5a37cd3
liquidity: fix flaky autoloop test
This failure became normal recently:

=== RUN   TestAutoLoopInEnabled
    autoloop_testcontext_test.go:318:
        	Error Trace:	/home/runner/work/loop/loop/liquidity/autoloop_testcontext_test.go:318
        	            				/home/runner/work/loop/loop/liquidity/autoloop_test.go:804
        	Error:      	Not equal:
        	            	expected: 80000
        	            	actual  : 160000
        	Test:       	TestAutoLoopInEnabled
    autoloop_testcontext_test.go:318:
        	Error Trace:	/home/runner/work/loop/loop/liquidity/autoloop_testcontext_test.go:318
        	            				/home/runner/work/loop/loop/liquidity/autoloop_test.go:804
        	Error:      	Not equal:
        	            	expected: 160000
        	            	actual  : 80000
        	Test:       	TestAutoLoopInEnabled
    autoloop_testcontext_test.go:343:
        	Error Trace:	/home/runner/work/loop/loop/liquidity/autoloop_testcontext_test.go:343
        	            				/home/runner/work/loop/loop/liquidity/autoloop_test.go:804
        	Error:      	Should be true
        	Test:       	TestAutoLoopInEnabled

The root cause is them the order of items in c.quoteRequestIn depends on the
order of loopInBuilder.buildSwap calls, which depends on the order of channel
handling in Manager.SuggestSwaps, which depends on the order of map traversal,
which is not determitistic.

Since in the test all the amounts are different, I used amount as a key and
put the expected calls into a map using amount as a key. When I extract an
item from c.quoteRequestIn channel, I find the corresponding item in the map
and remove it. All other logic is preserved.
2024-05-30 15:41:51 -03:00
Andras Banki-Horvath
87c8ca0d8b
liquidity: dest address support for easy autloop 2023-10-04 14:18:37 +02:00
George Tsagkarelis
e9bc1dcc9e
multi: add initiator to mocked interfaces for tests 2023-07-28 14:43:19 +03:00
Konstantin Nick
0781cafbfb
Merge pull request #585 from sputn1ck/sqlite
Migrate from boltdb to sql
2023-06-20 19:54:37 +02:00
sputn1ck
becc8a38d8
multi: use context in loopdb call
This commit adds a context to our loopdb interface, which we should use
in the sqlite migration.
2023-06-19 12:28:32 +02:00
George Tsagkarelis
afca558817
liquidity: add false-positive checks on autoloop tests 2023-06-14 16:27:46 +03:00
George Tsagkarelis
9a9766775a
liquidity: add easy autoloop test 2023-05-22 15:48:38 +03:00
George Tsagkarelis
aca6428b0e
liquidity+loopd: move last budget refresh to parameters 2023-03-16 02:10:32 +02:00
George Tsagkarelis
c17e5a6fc6
liquidity: fix tests for autoloop sticky loop out 2023-03-09 00:43:07 +02:00
George Tsagkarelis
5d6be011f9
liquidity: tweak autoloop tests for recurring budget 2023-02-22 19:48:04 +02:00
George Tsagkarelis
a14f6e8bd6
liquidity: add autoloop test for outaddr 2022-12-16 12:02:46 +02:00
yyforyongyu
425a007aaf
loopd+liquidity: persist parameters on disk
This commit saves the RPC request used to construct the `Parameters` on
disk. Since it's a proto message, an easy way to read/write it is to
rely on the proto marshal/unmarshal methods. A side effect is that
migration also becomes easy as proto message have its own internal
mechanism to keep track of the compatibility.
2022-06-07 20:18:11 +08:00
yyforyongyu
8217ee31c3
liquidity+loopd: refactor SetParameters to take a rpc request
This commit refactors the method `manager.SetParameters` to take a
`SetLiquidityParamsRequest`. As we'll see in the following commit, this
will enable us saving the params to disk more easily.
2022-06-07 19:19:52 +08:00
Harsha Goli
7a16e3b25d
multi: bump btcec/v2 and btcutil to new versions 2022-03-25 11:00:16 +01:00
carla
5280721636
multi: add ability to autoloop in 2021-12-15 09:01:22 +02:00
carla
c778124718
liquidity: move fees behind interface 2021-03-04 10:14:35 +02:00
carla
476ae39ce9
multi: make server side restrictions function generic 2021-02-03 08:54:50 +02:00
carla
24aa429aa0
liquidity: rename ticker and default to autoloop 2021-02-03 08:54:49 +02:00
carla
3f0fc14c34
liquidity: allow custom autoloop swap sizes within the server's limits 2020-12-01 13:06:35 +02:00
carla
8166d936e1
multi: add opt-in automated swap dispatch to liquidity manager 2020-10-12 13:34:55 +02:00