Commit Graph

20 Commits (16132d1593ce0db7a867b33a2f9cf09154d91f3f)

Author SHA1 Message Date
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.
1 month ago
Andras Banki-Horvath 87c8ca0d8b
liquidity: dest address support for easy autloop 9 months ago
George Tsagkarelis e9bc1dcc9e
multi: add initiator to mocked interfaces for tests 11 months ago
Konstantin Nick 0781cafbfb
Merge pull request #585 from sputn1ck/sqlite
Migrate from boltdb to sql
1 year ago
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.
1 year ago
George Tsagkarelis afca558817
liquidity: add false-positive checks on autoloop tests 1 year ago
George Tsagkarelis 9a9766775a
liquidity: add easy autoloop test 1 year ago
George Tsagkarelis aca6428b0e
liquidity+loopd: move last budget refresh to parameters 1 year ago
George Tsagkarelis c17e5a6fc6
liquidity: fix tests for autoloop sticky loop out 1 year ago
George Tsagkarelis 5d6be011f9
liquidity: tweak autoloop tests for recurring budget 1 year ago
George Tsagkarelis a14f6e8bd6
liquidity: add autoloop test for outaddr 2 years ago
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.
2 years ago
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.
2 years ago
Harsha Goli 7a16e3b25d
multi: bump btcec/v2 and btcutil to new versions 2 years ago
carla 5280721636
multi: add ability to autoloop in 3 years ago
carla c778124718
liquidity: move fees behind interface 3 years ago
carla 476ae39ce9
multi: make server side restrictions function generic 3 years ago
carla 24aa429aa0
liquidity: rename ticker and default to autoloop 3 years ago
carla 3f0fc14c34
liquidity: allow custom autoloop swap sizes within the server's limits 4 years ago
carla 8166d936e1
multi: add opt-in automated swap dispatch to liquidity manager 4 years ago