Updating the mocks to be complete implementation of the underlying
interfaces is not always possible due to cross dependency issues.
This commit embeds the interfaces into the mocks so we can at least
always compile them.
Size of a signature affects the weight of transaction, which is verified
in tests.
Also method SignOutputRaw now returns the number of signatures matching
the number of signature descriptors to prevent crashes in tests where
multiple inputs are signed.
This commit bumps LND and lndclient to make it possible to upgrade
taproot HTLC construction with a MuSig2 version. This is required to
support both old (MuSig2 0.4) and new (MuSig2 1.0) clients.
This commit fixes outstanding linter issues, that we're not found by
running `make lint` locally. The linter issues were found by running
`docker run -v $(pwd):/build loop-tools golangci-lint run --whole-files`
I added the `revive` to the excludes as it would be to much of a
refactor and IMO seems unneccesary. E.g.
`interface.go:222:6: exported: type name will be used as
loop.LoopInTerms by other packages, and that stutters; consider
calling this InTerms (revive)`. I think `loop.LoopInTerms` is fine.
In this commit we bump the minimum LND version required to run loopd to
v0.15.1-beta in order to ensure that the underlying chain backend
supports taproot (https://github.com/lightningnetwork/lnd/pull/6798)
In this commit, instead of importing SelectHopHints from lnd, we chose
to reimplement the functionality here, for the purpose of adding hop
hints in case the user informs us the client node is considered private.
In the future, we should modify the origin SelectHopHints to take
closures for all it's data sources, so we can use it's logic external
To allow code with more up-to-date dependencies to import loop, we
bump our lndclient version. The minimum loop version remains 11.1
since we're not using any new apis.
Our preimage push test previously relied on our dropping down to the
default sweep conf target to mock a drop in chain fees. This makes
our test dependent on height, which makes changes to our sweep logic
regarding when we reveal our preimage break this test. In this commit
that logic is replaced with simply locking our mock and updating fees
on the fly.
We update to the latest lndclient that now requires a label when
publishing an on-chain transaction. Instead of just adding an empty
string, we use the proper labels added in a previous commit.
Add a dated fee budget to our swap suggestions. This budget only applies
to automatically dispatched swaps (which will be added in later
commits). We choose to apply the fee budget to our suggestions so that
they perfectly replicate what the autolooper would do. The budget has a
start date so that it can be refreshed once it has been used up over a
period (rather than having to endlessly increase it).
We need the newer version of lndclient to get our synced to chain
state. This requires changes to our test mock, so it is separated
into a different commit. Since lndclient is expanding to be used in
projects other than loop, the client interface is embedded in our
mock rather than implementing functions we do not need. Functions that
we already use in tests are updated accordingly.
Note that while this commit bumps us to a version of lndclient that
defaults to requiring lnd 0.11, we do not bump our required version
yet because we are not using any new endpoints.
To allow users to specify differing confirmation targets, we store the
swap conf target per-swap. This makes us restart safe, so we do not
forget confirmation values for swaps that are in flight when we restart.
Once we have revealed our preimage to the world with a sweep attempt,
we can safely push our preimage to the server to speed up on chain
claim.
Rather than rely on the server, we use the state of our invoice in lnd
to determine whether we should continue trying to push the preimage to
the server.