multi: add labels to lnd native transactions
Follow up labelling of external transactions with labels for the transaction types we create within lnd. Since these labels will live a life of string matching, a version number and rigid format is added so that string matching is less painful. We start out with channel ID, where available, and a transaction "type". External labels, added in a previous PR, are not updated to this new versioned label because they are not lnd-initiated transactions. Label matching can check this case, then check for a version number.
This commit is contained in:
13 files changed
+225
-20
No files matched your search
+19
-6
@@ -1204,9 +1204,14 @@ func (n *NetworkHarness) WaitForChannelClose(ctx context.Context,
|
||||
}
|
||||
|
||||
// AssertChannelExists asserts that an active channel identified by the
|
||||
// specified channel point exists from the point-of-view of the node.
|
||||
// specified channel point exists from the point-of-view of the node. It takes
|
||||
// an optional set of check functions which can be used to make further
|
||||
// assertions using channel's values. These functions are responsible for
|
||||
// failing the test themselves if they do not pass.
|
||||
// nolint: interfacer
|
||||
func (n *NetworkHarness) AssertChannelExists(ctx context.Context,
|
||||
node *HarnessNode, chanPoint *wire.OutPoint) error {
|
||||
node *HarnessNode, chanPoint *wire.OutPoint,
|
||||
checks ...func(*lnrpc.Channel)) error {
|
||||
|
||||
req := &lnrpc.ListChannelsRequest{}
|
||||
|
||||
@@ -1218,12 +1223,20 @@ func (n *NetworkHarness) AssertChannelExists(ctx context.Context,
|
||||
|
||||
for _, channel := range resp.Channels {
|
||||
if channel.ChannelPoint == chanPoint.String() {
|
||||
if channel.Active {
|
||||
return nil
|
||||
// First check whether our channel is active,
|
||||
// failing early if it is not.
|
||||
if !channel.Active {
|
||||
return fmt.Errorf("channel %s inactive",
|
||||
chanPoint)
|
||||
}
|
||||
|
||||
return fmt.Errorf("channel %s inactive",
|
||||
chanPoint)
|
||||
// Apply any additional checks that we would
|
||||
// like to verify.
|
||||
for _, check := range checks {
|
||||
check(channel)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user