From 060a0d7f2c64d13c04971a15f4d35d882c4d9a0f Mon Sep 17 00:00:00 2001 From: Richard Myers Date: Thu, 9 Nov 2023 13:52:39 +0100 Subject: [PATCH] Remove unnecessary `safeSend` from tests --- .../channel/states/QuiescenceTestsCommon.kt | 20 +++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/src/commonTest/kotlin/fr/acinq/lightning/channel/states/QuiescenceTestsCommon.kt b/src/commonTest/kotlin/fr/acinq/lightning/channel/states/QuiescenceTestsCommon.kt index 429076687..202e23e3c 100644 --- a/src/commonTest/kotlin/fr/acinq/lightning/channel/states/QuiescenceTestsCommon.kt +++ b/src/commonTest/kotlin/fr/acinq/lightning/channel/states/QuiescenceTestsCommon.kt @@ -77,7 +77,7 @@ class QuiescenceTestsCommon : LightningTestSuite() { ) val (alice1, _, _) = initiateQuiescence(alice, bob, sendInitialStfu = false) cmds.forEach { - safeSend(alice1, listOf(it)).second.findCommandError() + alice1.process(it).second.findCommandError() } } @@ -92,12 +92,11 @@ class QuiescenceTestsCommon : LightningTestSuite() { ) val (alice1, bob1, _) = initiateQuiescence(alice, bob, sendInitialStfu = true) cmds.forEach { - safeSend(alice1, listOf(it)).second.findCommandError() + alice1.process(it).second.findCommandError() } cmds.forEach { - safeSend(bob1, listOf(it)).second.findCommandError() + bob1.process(it).second.findCommandError() } - safeSend(bob, cmds) } @Test @@ -459,19 +458,6 @@ class QuiescenceTestsCommon : LightningTestSuite() { } } - private fun safeSend(r: LNChannel, cmds: List): Pair, List> { - var receiver: LNChannel = r - val actions = buildList { - cmds.forEach { - val (r1, a) = receiver.process(it) - assertIs>(r1) - receiver = r1 - addAll(a) - } - } - return Pair(receiver, actions) - } - private fun initiateQuiescence(sender: LNChannel, receiver: LNChannel, sendInitialStfu: Boolean): Triple, LNChannel, LightningMessage> { val cmd = ChannelCommand.Commitment.Splice.Request( replyTo = CompletableDeferred(),