channeldb: prepare RevocationLog for optional fields

This commit is a pure refactor. It restructures the RevocationLog
serialize and deserialize methods so that optional TLV fields can be
easily added.
This commit is contained in:
Elle Mouton committed 2023-02-16 07:51:48 +02:00
1 parent 38dc67e1ef
commit ce8e7ecfa7
3 files changed
+90 -74

No files matched your search

+2 -2
View File
@@ -127,7 +127,7 @@ func TestReadTLVStream(t *testing.T) {
// Read the tlv stream.
buf := bytes.NewBuffer(testValueBytes)
err = readTlvStream(buf, ts)
_, err = readTlvStream(buf, ts)
require.NoError(t, err)
// Check the bytes are read as expected.
@@ -150,7 +150,7 @@ func TestReadTLVStreamErr(t *testing.T) {
// Read the tlv stream.
buf := bytes.NewBuffer(b)
err = readTlvStream(buf, ts)
_, err = readTlvStream(buf, ts)
require.ErrorIs(t, err, io.ErrUnexpectedEOF)
// Check the bytes are not read.