|
|
|
|
@ -34,7 +34,7 @@ class TestWalletPaymentRequests(ElectrumTestCase):
|
|
|
|
|
funding_tx = Transaction('0200000000010132515e6aade1b79ec7dd3bac0896d8b32c56195d23d07d48e21659cef24301560100000000fdffffff0112841e000000000016001477fe6d2a27e8860c278d4d2cd90bad716bb9521a02473044022041ed68ef7ef122813ac6a5e996b8284f645c53fbe6823b8e430604a8915a867802203233f5f4d347a687eb19b2aa570829ab12aeeb29a24cc6d6d20b8b3d79e971ae012102bee0ee043817e50ac1bb31132770f7c41e35946ccdcb771750fb9696bdd1b307ad951d00') |
|
|
|
|
funding_txid = funding_tx.txid() |
|
|
|
|
assert 'db949963c3787c90a40fb689ffdc3146c27a9874a970d1fd20921afbe79a7aa9' == funding_txid |
|
|
|
|
wallet2.adb.receive_tx_callback(funding_txid, funding_tx, TX_HEIGHT_UNCONFIRMED) |
|
|
|
|
wallet2.adb.receive_tx_callback(funding_tx, TX_HEIGHT_UNCONFIRMED) |
|
|
|
|
return wallet2 |
|
|
|
|
|
|
|
|
|
async def test_wallet_with_ln_creates_payreq_and_gets_paid_on_ln(self): |
|
|
|
|
@ -73,7 +73,7 @@ class TestWalletPaymentRequests(ElectrumTestCase):
|
|
|
|
|
wallet2 = self.create_wallet2() # type: Standard_Wallet |
|
|
|
|
outputs = [PartialTxOutput.from_address_and_value(pr.get_address(), pr.get_amount_sat())] |
|
|
|
|
tx = wallet2.create_transaction(outputs=outputs, fee=5000) |
|
|
|
|
wallet1.adb.receive_tx_callback(tx.txid(), tx, TX_HEIGHT_UNCONFIRMED) |
|
|
|
|
wallet1.adb.receive_tx_callback(tx, TX_HEIGHT_UNCONFIRMED) |
|
|
|
|
self.assertEqual(PR_UNCONFIRMED, wallet1.get_invoice_status(pr)) |
|
|
|
|
# tx gets mined |
|
|
|
|
wallet1.db.put('stored_height', 1010) |
|
|
|
|
@ -103,7 +103,7 @@ class TestWalletPaymentRequests(ElectrumTestCase):
|
|
|
|
|
wallet2 = self.create_wallet2() # type: Standard_Wallet |
|
|
|
|
outputs = [PartialTxOutput.from_address_and_value(pr.get_address(), pr.get_amount_sat())] |
|
|
|
|
tx = wallet2.create_transaction(outputs=outputs, fee=5000) |
|
|
|
|
wallet1.adb.receive_tx_callback(tx.txid(), tx, TX_HEIGHT_UNCONFIRMED) |
|
|
|
|
wallet1.adb.receive_tx_callback(tx, TX_HEIGHT_UNCONFIRMED) |
|
|
|
|
self.assertEqual(PR_UNCONFIRMED, wallet1.get_invoice_status(pr)) |
|
|
|
|
# tx gets mined |
|
|
|
|
wallet1.db.put('stored_height', 1010) |
|
|
|
|
@ -133,7 +133,7 @@ class TestWalletPaymentRequests(ElectrumTestCase):
|
|
|
|
|
wallet2 = self.create_wallet2() # type: Standard_Wallet |
|
|
|
|
outputs = [PartialTxOutput.from_address_and_value(pr.get_address(), pr.get_amount_sat())] |
|
|
|
|
tx = wallet2.create_transaction(outputs=outputs, fee=5000) |
|
|
|
|
wallet1.adb.receive_tx_callback(tx.txid(), tx, TX_HEIGHT_UNCONFIRMED) |
|
|
|
|
wallet1.adb.receive_tx_callback(tx, TX_HEIGHT_UNCONFIRMED) |
|
|
|
|
self.assertEqual(PR_UNCONFIRMED, wallet1.get_invoice_status(pr)) |
|
|
|
|
# tx mined in the past (before invoice creation) |
|
|
|
|
tx_info = TxMinedInfo(height=990, |
|
|
|
|
@ -184,7 +184,7 @@ class TestWalletPaymentRequests(ElectrumTestCase):
|
|
|
|
|
wallet2 = self.create_wallet2() # type: Standard_Wallet |
|
|
|
|
outputs = [PartialTxOutput.from_address_and_value(pr2.get_address(), pr2.get_amount_sat())] |
|
|
|
|
tx = wallet2.create_transaction(outputs=outputs, fee=5000) |
|
|
|
|
wallet1.adb.receive_tx_callback(tx.txid(), tx, TX_HEIGHT_UNCONFIRMED) |
|
|
|
|
wallet1.adb.receive_tx_callback(tx, TX_HEIGHT_UNCONFIRMED) |
|
|
|
|
self.assertEqual(PR_UNCONFIRMED, wallet1.get_invoice_status(pr2)) |
|
|
|
|
|
|
|
|
|
# create payreq4, which should not reuse addr2 |
|
|
|
|
@ -255,7 +255,7 @@ class TestWalletPaymentRequests(ElectrumTestCase):
|
|
|
|
|
wallet2 = self.create_wallet2() # type: Standard_Wallet |
|
|
|
|
outputs = [PartialTxOutput.from_address_and_value(pr2.get_address(), pr2.get_amount_sat())] |
|
|
|
|
tx = wallet2.create_transaction(outputs=outputs, fee=5000) |
|
|
|
|
wallet1.adb.receive_tx_callback(tx.txid(), tx, TX_HEIGHT_UNCONFIRMED) |
|
|
|
|
wallet1.adb.receive_tx_callback(tx, TX_HEIGHT_UNCONFIRMED) |
|
|
|
|
self.assertEqual(PR_UNCONFIRMED, wallet1.get_invoice_status(pr2)) |
|
|
|
|
self.assertEqual(pr2, wallet1.get_request_by_addr(addr1)) |
|
|
|
|
|
|
|
|
|
|