mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-22 14:22:37 +01:00
lnwallet/test: assert final resolution db storage
This commit is contained in:
parent
266cd97573
commit
b50d59ec2e
1 changed files with 9 additions and 2 deletions
|
@ -241,13 +241,20 @@ func testAddSettleWorkflow(t *testing.T, tweakless bool) {
|
|||
|
||||
bobRevocation2, _, finalHtlcs, err := bobChannel.
|
||||
RevokeCurrentCommitment()
|
||||
|
||||
require.NoError(t, err, "bob unable to revoke commitment")
|
||||
|
||||
// Check finalHtlcs for the expected final resolution.
|
||||
require.Len(t, finalHtlcs, 1, "final htlc expected")
|
||||
for _, settled := range finalHtlcs {
|
||||
for htlcID, settled := range finalHtlcs {
|
||||
require.True(t, settled, "final settle expected")
|
||||
|
||||
// Assert that final resolution was stored in Bob's database.
|
||||
finalInfo, err := bobChannel.channelState.Db.LookupFinalHtlc(
|
||||
bobChannel.ShortChanID(), htlcID,
|
||||
)
|
||||
require.NoError(t, err)
|
||||
require.True(t, finalInfo.Offchain)
|
||||
require.True(t, finalInfo.Settled)
|
||||
}
|
||||
|
||||
fwdPkg, _, _, _, err = aliceChannel.ReceiveRevocation(bobRevocation2)
|
||||
|
|
Loading…
Add table
Reference in a new issue