mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-04 21:05:11 +00:00
fix tests (follow up prev commit)
This commit is contained in:
parent
8d77a7ecd8
commit
4dc6c6c82e
3 changed files with 10 additions and 5 deletions
|
@ -201,6 +201,7 @@ class TestChannel(unittest.TestCase):
|
|||
'payment_hash' : paymentHash,
|
||||
'amount_msat' : one_bitcoin_in_msat,
|
||||
'cltv_expiry' : 5,
|
||||
'timestamp' : 0,
|
||||
}
|
||||
|
||||
# First Alice adds the outgoing HTLC to her local channel's state
|
||||
|
@ -604,6 +605,7 @@ class TestAvailableToSpend(unittest.TestCase):
|
|||
'payment_hash' : paymentHash,
|
||||
'amount_msat' : int(4.1 * one_bitcoin_in_msat),
|
||||
'cltv_expiry' : 5,
|
||||
'timestamp' : 0,
|
||||
}
|
||||
|
||||
alice_idx = alice_channel.add_htlc(htlc_dict).htlc_id
|
||||
|
@ -622,6 +624,7 @@ class TestAvailableToSpend(unittest.TestCase):
|
|||
'payment_hash' : paymentHash,
|
||||
'amount_msat' : one_bitcoin_in_msat,
|
||||
'cltv_expiry' : 5,
|
||||
'timestamp' : 0,
|
||||
}
|
||||
with self.assertRaises(lnutil.PaymentFailure):
|
||||
alice_channel.add_htlc(htlc_dict)
|
||||
|
@ -669,6 +672,7 @@ class TestChanReserve(unittest.TestCase):
|
|||
'payment_hash' : paymentHash,
|
||||
'amount_msat' : int(.5 * one_bitcoin_in_msat),
|
||||
'cltv_expiry' : 5,
|
||||
'timestamp' : 0,
|
||||
}
|
||||
self.alice_channel.add_htlc(htlc_dict)
|
||||
self.bob_channel.receive_htlc(htlc_dict)
|
||||
|
@ -729,6 +733,7 @@ class TestChanReserve(unittest.TestCase):
|
|||
'payment_hash' : paymentHash,
|
||||
'amount_msat' : int(2 * one_bitcoin_in_msat),
|
||||
'cltv_expiry' : 5,
|
||||
'timestamp' : 0,
|
||||
}
|
||||
alice_idx = self.alice_channel.add_htlc(htlc_dict).htlc_id
|
||||
bob_idx = self.bob_channel.receive_htlc(htlc_dict).htlc_id
|
||||
|
@ -773,6 +778,7 @@ class TestDust(unittest.TestCase):
|
|||
'payment_hash' : paymentHash,
|
||||
'amount_msat' : 1000 * htlcAmt,
|
||||
'cltv_expiry' : 5, # also in create_test_channels
|
||||
'timestamp' : 0,
|
||||
}
|
||||
|
||||
old_values = [x.value for x in bob_channel.current_commitment(LOCAL).outputs() ]
|
||||
|
|
|
@ -109,12 +109,11 @@ class MockLNWorker:
|
|||
def on_channels_updated(self):
|
||||
pass
|
||||
|
||||
def save_invoice(*args):
|
||||
def save_invoice(*args, is_paid=False):
|
||||
pass
|
||||
|
||||
get_invoice = LNWorker.get_invoice
|
||||
get_preimage = LNWorker.get_preimage
|
||||
get_preimage_and_timestamp = LNWorker.get_preimage_and_timestamp
|
||||
_create_route_from_invoice = LNWorker._create_route_from_invoice
|
||||
_check_invoice = staticmethod(LNWorker._check_invoice)
|
||||
_pay_to_route = LNWorker._pay_to_route
|
||||
|
@ -216,8 +215,8 @@ class TestPeer(SequentialTestCase):
|
|||
('d', 'coffee')
|
||||
])
|
||||
pay_req = lnencode(addr, w2.node_keypair.privkey)
|
||||
w2.preimages[bh2u(RHASH)] = (bh2u(payment_preimage), 0)
|
||||
w2.invoices[bh2u(RHASH)] = (pay_req, True)
|
||||
w2.preimages[bh2u(RHASH)] = bh2u(payment_preimage)
|
||||
w2.invoices[bh2u(RHASH)] = (pay_req, True, False)
|
||||
return pay_req
|
||||
|
||||
@staticmethod
|
||||
|
|
|
@ -495,7 +495,7 @@ class TestLNUtil(unittest.TestCase):
|
|||
(1, 2000 * 1000),
|
||||
(3, 3000 * 1000),
|
||||
(4, 4000 * 1000)]:
|
||||
htlc_obj[num] = UpdateAddHtlc(amount_msat=msat, payment_hash=bitcoin.sha256(htlc_payment_preimage[num]), cltv_expiry=None, htlc_id=None)
|
||||
htlc_obj[num] = UpdateAddHtlc(amount_msat=msat, payment_hash=bitcoin.sha256(htlc_payment_preimage[num]), cltv_expiry=None, htlc_id=None, timestamp=0)
|
||||
htlcs = [ScriptHtlc(htlc[x], htlc_obj[x]) for x in range(5)]
|
||||
|
||||
our_commit_tx = make_commitment(
|
||||
|
|
Loading…
Add table
Reference in a new issue