mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-12-07 11:22:37 +01:00
graph/db: use only exported KVStore methods in tests
Replace all calls to bbolt specific methods on the KVStore to instead use exported methods on the KVStore that are more db-agnostic.
This commit is contained in:
@@ -1217,26 +1217,15 @@ func TestGraphTraversalCacheable(t *testing.T) {
|
|||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Len(t, nodeMap, 0)
|
require.Len(t, nodeMap, 0)
|
||||||
|
|
||||||
err = graph.db.View(func(tx kvdb.RTx) error {
|
for _, node := range nodes {
|
||||||
for _, node := range nodes {
|
err = graph.ForEachNodeDirectedChannel(
|
||||||
err := graph.forEachNodeChannelTx(tx, node,
|
node, func(d *DirectedChannel) error {
|
||||||
func(tx kvdb.RTx, info *models.ChannelEdgeInfo,
|
delete(chanIndex, d.ChannelID)
|
||||||
policy *models.ChannelEdgePolicy,
|
return nil
|
||||||
policy2 *models.ChannelEdgePolicy) error { //nolint:ll
|
},
|
||||||
|
)
|
||||||
delete(chanIndex, info.ChannelID)
|
require.NoError(t, err)
|
||||||
return nil
|
}
|
||||||
},
|
|
||||||
)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}, func() {})
|
|
||||||
|
|
||||||
require.NoError(t, err)
|
|
||||||
require.Len(t, chanIndex, 0)
|
require.Len(t, chanIndex, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user