Browse Source

lnhtlc: test that sent amount is received

dependabot/pip/contrib/deterministic-build/ecdsa-0.13.3
Janus 7 years ago
committed by ThomasV
parent
commit
6f5209ef85
  1. 1
      electrum/lnhtlc.py
  2. 3
      electrum/tests/test_lnhtlc.py

1
electrum/lnhtlc.py

@ -439,6 +439,7 @@ class HTLCStateMachine(PrintError):
self.local_commitment = self.pending_local_commitment self.local_commitment = self.pending_local_commitment
self.remote_commitment = self.pending_remote_commitment self.remote_commitment = self.pending_remote_commitment
self.remote_commitment_to_be_revoked = prev_remote_commitment self.remote_commitment_to_be_revoked = prev_remote_commitment
return received_this_batch, sent_this_batch
@staticmethod @staticmethod
def htlcsum(htlcs): def htlcsum(htlcs):

3
electrum/tests/test_lnhtlc.py

@ -223,7 +223,8 @@ class TestLNBaseHTLCStateMachine(unittest.TestCase):
aliceSig2, aliceHtlcSigs2 = alice_channel.sign_next_commitment() aliceSig2, aliceHtlcSigs2 = alice_channel.sign_next_commitment()
self.assertEqual(aliceHtlcSigs2, [], "alice should generate no htlc signatures") 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) bob_channel.receive_new_commitment(aliceSig2, aliceHtlcSigs2)

Loading…
Cancel
Save