From c6a187a5d710d2366ba8ae44a97ebeb59f4d6543 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 10 Nov 2016 23:33:35 +1030 Subject: [PATCH] helpers.sh: set up funding in start_lightningd() Every test wants this anyway. Signed-off-by: Rusty Russell --- daemon/test/scripts/helpers.sh | 8 ++++++++ daemon/test/test.sh | 6 ------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/daemon/test/scripts/helpers.sh b/daemon/test/scripts/helpers.sh index f7da876eb..b036d7ce3 100644 --- a/daemon/test/scripts/helpers.sh +++ b/daemon/test/scripts/helpers.sh @@ -188,6 +188,14 @@ start_lightningd() PORT2=`get_info_field "$LCLI2" port` [ $NUM_LIGHTNINGD = 2 ] || PORT3=`get_info_field "$LCLI3" port` + + # Make a payment into a P2SH for anchor. + P2SHADDR=`$LCLI1 newaddr | sed -n 's/{ "address" : "\(.*\)" }/\1/p'` + FUND_INPUT_TXID=`$CLI sendtoaddress $P2SHADDR 0.01` + FUND_INPUT_TX=`$CLI getrawtransaction $FUND_INPUT_TXID` + + # Mine it so check_tx_spend doesn't see it (breaks some tests). + $CLI generate 1 } lcli1() diff --git a/daemon/test/test.sh b/daemon/test/test.sh index 5ec67696e..2623fcdd1 100755 --- a/daemon/test/test.sh +++ b/daemon/test/test.sh @@ -65,12 +65,6 @@ start_lightningd 3 [ `$LCLI2 getlog | sed -n 's/.*"ID: \([0-9a-f]*\)".*/\1/p'` = $ID2 ] [ $NUM_LIGHTNINGD = 2 ] || [ `$LCLI3 getlog | sed -n 's/.*"ID: \([0-9a-f]*\)".*/\1/p'` = $ID3 ] -# Make a payment into a P2SH for anchor. -P2SHADDR=`$LCLI1 newaddr | sed -n 's/{ "address" : "\(.*\)" }/\1/p'` -TXID=`$CLI sendtoaddress $P2SHADDR 0.01` -TX=`$CLI getrawtransaction $TXID` -$CLI generate 1 - # Make sure they see it (for timeout we need to know what height they were) BLOCKHEIGHT=`$CLI getblockcount` check '[ `get_info_field "$LCLI1" blockheight` = $BLOCKHEIGHT ]'