From e27a9fec66b70e03f63e67406c066dd98e716952 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Tue, 10 May 2022 18:31:18 +0200 Subject: [PATCH] lntest: rename sendCoins to SendCoinsOfType --- lntest/harness_net.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lntest/harness_net.go b/lntest/harness_net.go index fc88e28fb..5fde91419 100644 --- a/lntest/harness_net.go +++ b/lntest/harness_net.go @@ -1417,7 +1417,7 @@ func (n *NetworkHarness) DumpLogs(node *HarnessNode) (string, error) { func (n *NetworkHarness) SendCoins(t *testing.T, amt btcutil.Amount, target *HarnessNode) { - err := n.sendCoins( + err := n.SendCoinsOfType( amt, target, lnrpc.AddressType_WITNESS_PUBKEY_HASH, true, ) require.NoErrorf(t, err, "unable to send coins for %s", target.Cfg.Name) @@ -1429,7 +1429,7 @@ func (n *NetworkHarness) SendCoins(t *testing.T, amt btcutil.Amount, func (n *NetworkHarness) SendCoinsUnconfirmed(t *testing.T, amt btcutil.Amount, target *HarnessNode) { - err := n.sendCoins( + err := n.SendCoinsOfType( amt, target, lnrpc.AddressType_WITNESS_PUBKEY_HASH, false, ) require.NoErrorf( @@ -1443,7 +1443,7 @@ func (n *NetworkHarness) SendCoinsUnconfirmed(t *testing.T, amt btcutil.Amount, func (n *NetworkHarness) SendCoinsNP2WKH(t *testing.T, amt btcutil.Amount, target *HarnessNode) { - err := n.sendCoins( + err := n.SendCoinsOfType( amt, target, lnrpc.AddressType_NESTED_PUBKEY_HASH, true, ) require.NoErrorf( @@ -1457,16 +1457,18 @@ func (n *NetworkHarness) SendCoinsNP2WKH(t *testing.T, amt btcutil.Amount, func (n *NetworkHarness) SendCoinsP2TR(t *testing.T, amt btcutil.Amount, target *HarnessNode) { - err := n.sendCoins(amt, target, lnrpc.AddressType_TAPROOT_PUBKEY, true) + err := n.SendCoinsOfType( + amt, target, lnrpc.AddressType_TAPROOT_PUBKEY, true, + ) require.NoErrorf( t, err, "unable to send P2TR coins for %s", target.Cfg.Name, ) } -// sendCoins attempts to send amt satoshis from the internal mining node to the -// targeted lightning node. The confirmed boolean indicates whether the +// SendCoinsOfType attempts to send amt satoshis from the internal mining node +// to the targeted lightning node. The confirmed boolean indicates whether the // transaction that pays to the target should confirm. -func (n *NetworkHarness) sendCoins(amt btcutil.Amount, target *HarnessNode, +func (n *NetworkHarness) SendCoinsOfType(amt btcutil.Amount, target *HarnessNode, addrType lnrpc.AddressType, confirmed bool) error { ctx, cancel := context.WithTimeout(n.runCtx, DefaultTimeout)