This commit introduces a new generic type assertion function
`assertState` to the state machine tests. This function asserts that the
state machine is currently in the expected state type and returns the
state cast to that type. This allows us to directly access the fields of
the state without having to perform a type assertion manually.
In this commit, we add a new ConfMapper which is useful for state
machines that want to project some of the conf attributes into a new
event to be sent post conf.
We can remove paymentFailureInfo since we can gate the result
interpretation on the source index, meaning that if we don't have a
source index, we deal with an unknown payment outcome because we
couldn't pinpoint the failing hop.
Previously we'd skip returning immature inputs to stay backwards
compatible. This has the downside as the node operator cannot take
actions on this input, like some customized batching strategy via
`bumpfee` RPC.
After this change, it means when calling `bumpfee` RPC, it will now
update the params for the immature input instead of returning an error
saying `output does not belong to wallet`.
We also add a `MaturityHeight` field so the user knows when this input
will be swept.
Make sure that an address imported to LND via ImportTapscript or ImportPublicKey
can be used as a delivery address in coop close.
New test cases:
- P2TR address imported with ImportTapscript
- P2TR address imported with ImportPublicKey
- P2WPKH address imported with ImportPublicKey
Safeguard against https://github.com/lightninglabs/loop/issues/923
More sub-tests are needed in "coop close with external delivery" itest, which
would break the limit for 50 blocks mined. Turning it into prefixed itest.
Also used new exclusion approach in test "remote signer" where all the prefixed
tests are excluded.
An address imported using ImportTapscript doesn't provide a private key
so it can't satisfy waddrmgr.ManagedPubKeyAddress interface. So we don't
return an error for imported addresses.
Fix https://github.com/lightninglabs/loop/issues/923
The MW interceptor works via a stream & sends requests to the
interceptor via this stream. Sometimes, the interceptor might want to
work with grpc metadata pairs that were sent via the context of the
original request though and so in this commit, we ensure that for each
request sent via the stream to the interceptr, the grpc metadata is sent
along explicitly as well. This is done by adding a new `metadata_pairs`
field to the RPCMiddlewareRequest proto message.