channeldb: replace method RevocationLogTail

This commit replaces the method RevocationLogTail which in used in our
unit test with a private method revocationLogTailCommitHeight. The new
method returns the commit height only since that's what's needed in the
test.
This commit is contained in:
yyforyongyu committed 2022-04-20 01:18:11 +08:00
1 parent fcb314bf2c
commit 5f508f9278
2 files changed
+21 -27

No files matched your search

+4 -4
View File
@@ -791,11 +791,11 @@ func TestChannelStateTransition(t *testing.T) {
// The state number recovered from the tail of the revocation log
// should be identical to this current state.
logTail, err := channel.RevocationLogTail()
logTailHeight, err := channel.revocationLogTailCommitHeight()
if err != nil {
t.Fatalf("unable to retrieve log: %v", err)
}
if logTail.CommitHeight != oldRemoteCommit.CommitHeight {
if logTailHeight != oldRemoteCommit.CommitHeight {
t.Fatal("update number doesn't match")
}
@@ -827,11 +827,11 @@ func TestChannelStateTransition(t *testing.T) {
// Once again, state number recovered from the tail of the revocation
// log should be identical to this current state.
logTail, err = channel.RevocationLogTail()
logTailHeight, err = channel.revocationLogTailCommitHeight()
if err != nil {
t.Fatalf("unable to retrieve log: %v", err)
}
if logTail.CommitHeight != oldRemoteCommit.CommitHeight {
if logTailHeight != oldRemoteCommit.CommitHeight {
t.Fatal("update number doesn't match")
}