mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-12-14 23:06:04 +01:00
channeldb/channel_test: test ShortChanID is updated in-mem
Modifies TestFetchPendingChannels to verify that calls to MarkAsOpen also modify the in-memory state. Previously we only tested the persistent state loaded immediately after.
This commit is contained in:
@@ -684,6 +684,16 @@ func TestFetchPendingChannels(t *testing.T) {
|
|||||||
t.Fatalf("unable to mark channel as open: %v", err)
|
t.Fatalf("unable to mark channel as open: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if pendingChannels[0].IsPending {
|
||||||
|
t.Fatalf("channel marked open should no longer be pending")
|
||||||
|
}
|
||||||
|
|
||||||
|
if pendingChannels[0].ShortChanID != chanOpenLoc {
|
||||||
|
t.Fatalf("channel opening height not updated: expected %v, "+
|
||||||
|
"got %v", spew.Sdump(pendingChannels[0].ShortChanID),
|
||||||
|
chanOpenLoc)
|
||||||
|
}
|
||||||
|
|
||||||
// Next, we'll re-fetch the channel to ensure that the open height was
|
// Next, we'll re-fetch the channel to ensure that the open height was
|
||||||
// properly set.
|
// properly set.
|
||||||
openChans, err := cdb.FetchAllChannels()
|
openChans, err := cdb.FetchAllChannels()
|
||||||
|
|||||||
Reference in New Issue
Block a user