channeldb/graphdb: move outpoint ser/deser funcs to graphdb

We have the same helpers for writing and reading a wire.Outpoint type
defined separately in a couple places. We will want to use these from
the graph db package soon though so instead of defining them again
there, this commit unifies things and creates a single exported set of
helpers. The next commit will make use of these.
This commit is contained in:
Elle Mouton committed 2024-11-28 13:34:08 +02:00
1 parent 3365461500
commit 382539a6eb
7 files changed
+69 -52

No files matched your search

+2 -1
View File
@@ -6,6 +6,7 @@ import (
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
graphdb "github.com/lightningnetwork/lnd/graph/db"
"github.com/lightningnetwork/lnd/kvdb"
"github.com/stretchr/testify/require"
)
@@ -137,7 +138,7 @@ func TestFetchChannelWriteBucket(t *testing.T) {
error) {
var chanPointBuf bytes.Buffer
err := writeOutpoint(&chanPointBuf, &testChanPoint1)
err := graphdb.WriteOutpoint(&chanPointBuf, &testChanPoint1)
require.NoError(t, err)
return chainHash.CreateBucketIfNotExists(chanPointBuf.Bytes())