tlnhtlc: test that sent amount is received - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 6f5209ef8506fd889064cee9753ad8aaee02ad42 DIR parent 261fefb6f3b426940a865562dc9c67942ada25b8 HTML Author: Janus <ysangkok@gmail.com> Date: Wed, 12 Sep 2018 21:01:00 +0200 lnhtlc: test that sent amount is received Diffstat: M electrum/lnhtlc.py | 1 + M electrum/tests/test_lnhtlc.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) --- DIR diff --git a/electrum/lnhtlc.py b/electrum/lnhtlc.py t@@ -439,6 +439,7 @@ class HTLCStateMachine(PrintError): self.local_commitment = self.pending_local_commitment self.remote_commitment = self.pending_remote_commitment self.remote_commitment_to_be_revoked = prev_remote_commitment + return received_this_batch, sent_this_batch @staticmethod def htlcsum(htlcs): DIR diff --git a/electrum/tests/test_lnhtlc.py b/electrum/tests/test_lnhtlc.py t@@ -223,7 +223,8 @@ class TestLNBaseHTLCStateMachine(unittest.TestCase): aliceSig2, aliceHtlcSigs2 = alice_channel.sign_next_commitment() self.assertEqual(aliceHtlcSigs2, [], "alice should generate no htlc signatures") - bob_channel.receive_revocation(aliceRevocation2) + received, sent = bob_channel.receive_revocation(aliceRevocation2) + self.assertEqual(received, one_bitcoin_in_msat) bob_channel.receive_new_commitment(aliceSig2, aliceHtlcSigs2)