|
|
@ -570,7 +570,7 @@ class TestWalletSending(TestCaseForTestnet): |
|
|
|
|
|
|
|
# wallet1 -> wallet2 |
|
|
|
outputs = [TxOutput(bitcoin.TYPE_ADDRESS, wallet2.get_receiving_address(), 250000)] |
|
|
|
tx = wallet1.mktx(outputs=outputs, password=None, config=self.config, fee=5000) |
|
|
|
tx = wallet1.mktx(outputs=outputs, password=None, config=self.config, fee=5000, tx_version=1) |
|
|
|
|
|
|
|
self.assertTrue(tx.is_complete()) |
|
|
|
self.assertTrue(tx.is_segwit()) |
|
|
@ -590,7 +590,7 @@ class TestWalletSending(TestCaseForTestnet): |
|
|
|
|
|
|
|
# wallet2 -> wallet1 |
|
|
|
outputs = [TxOutput(bitcoin.TYPE_ADDRESS, wallet1.get_receiving_address(), 100000)] |
|
|
|
tx = wallet2.mktx(outputs=outputs, password=None, config=self.config, fee=5000) |
|
|
|
tx = wallet2.mktx(outputs=outputs, password=None, config=self.config, fee=5000, tx_version=1) |
|
|
|
|
|
|
|
self.assertTrue(tx.is_complete()) |
|
|
|
self.assertFalse(tx.is_segwit()) |
|
|
@ -643,7 +643,7 @@ class TestWalletSending(TestCaseForTestnet): |
|
|
|
|
|
|
|
# wallet1 -> wallet2 |
|
|
|
outputs = [TxOutput(bitcoin.TYPE_ADDRESS, wallet2.get_receiving_address(), 370000)] |
|
|
|
tx = wallet1a.mktx(outputs=outputs, password=None, config=self.config, fee=5000) |
|
|
|
tx = wallet1a.mktx(outputs=outputs, password=None, config=self.config, fee=5000, tx_version=1) |
|
|
|
tx = Transaction(tx.serialize()) # simulates moving partial txn between cosigners |
|
|
|
self.assertFalse(tx.is_complete()) |
|
|
|
wallet1b.sign_transaction(tx, password=None) |
|
|
@ -666,7 +666,7 @@ class TestWalletSending(TestCaseForTestnet): |
|
|
|
|
|
|
|
# wallet2 -> wallet1 |
|
|
|
outputs = [TxOutput(bitcoin.TYPE_ADDRESS, wallet1a.get_receiving_address(), 100000)] |
|
|
|
tx = wallet2.mktx(outputs=outputs, password=None, config=self.config, fee=5000) |
|
|
|
tx = wallet2.mktx(outputs=outputs, password=None, config=self.config, fee=5000, tx_version=1) |
|
|
|
|
|
|
|
self.assertTrue(tx.is_complete()) |
|
|
|
self.assertFalse(tx.is_segwit()) |
|
|
@ -734,7 +734,7 @@ class TestWalletSending(TestCaseForTestnet): |
|
|
|
|
|
|
|
# wallet1 -> wallet2 |
|
|
|
outputs = [TxOutput(bitcoin.TYPE_ADDRESS, wallet2a.get_receiving_address(), 165000)] |
|
|
|
tx = wallet1a.mktx(outputs=outputs, password=None, config=self.config, fee=5000) |
|
|
|
tx = wallet1a.mktx(outputs=outputs, password=None, config=self.config, fee=5000, tx_version=1) |
|
|
|
txid = tx.txid() |
|
|
|
tx = Transaction(tx.serialize()) # simulates moving partial txn between cosigners |
|
|
|
self.assertEqual(txid, tx.txid()) |
|
|
@ -760,7 +760,7 @@ class TestWalletSending(TestCaseForTestnet): |
|
|
|
|
|
|
|
# wallet2 -> wallet1 |
|
|
|
outputs = [TxOutput(bitcoin.TYPE_ADDRESS, wallet1a.get_receiving_address(), 100000)] |
|
|
|
tx = wallet2a.mktx(outputs=outputs, password=None, config=self.config, fee=5000) |
|
|
|
tx = wallet2a.mktx(outputs=outputs, password=None, config=self.config, fee=5000, tx_version=1) |
|
|
|
txid = tx.txid() |
|
|
|
tx = Transaction(tx.serialize()) # simulates moving partial txn between cosigners |
|
|
|
self.assertEqual(txid, tx.txid()) |
|
|
@ -814,7 +814,7 @@ class TestWalletSending(TestCaseForTestnet): |
|
|
|
|
|
|
|
# wallet1 -> wallet2 |
|
|
|
outputs = [TxOutput(bitcoin.TYPE_ADDRESS, wallet2.get_receiving_address(), 1000000)] |
|
|
|
tx = wallet1a.mktx(outputs=outputs, password=None, config=self.config, fee=5000) |
|
|
|
tx = wallet1a.mktx(outputs=outputs, password=None, config=self.config, fee=5000, tx_version=1) |
|
|
|
|
|
|
|
self.assertTrue(tx.is_complete()) |
|
|
|
self.assertFalse(tx.is_segwit()) |
|
|
@ -834,7 +834,7 @@ class TestWalletSending(TestCaseForTestnet): |
|
|
|
|
|
|
|
# wallet2 -> wallet1 |
|
|
|
outputs = [TxOutput(bitcoin.TYPE_ADDRESS, wallet1a.get_receiving_address(), 300000)] |
|
|
|
tx = wallet2.mktx(outputs=outputs, password=None, config=self.config, fee=5000) |
|
|
|
tx = wallet2.mktx(outputs=outputs, password=None, config=self.config, fee=5000, tx_version=1) |
|
|
|
|
|
|
|
self.assertTrue(tx.is_complete()) |
|
|
|
self.assertTrue(tx.is_segwit()) |
|
|
@ -874,6 +874,7 @@ class TestWalletSending(TestCaseForTestnet): |
|
|
|
tx = wallet.make_unsigned_transaction(coins, outputs, config=self.config, fixed_fee=5000) |
|
|
|
tx.set_rbf(True) |
|
|
|
tx.locktime = 1325501 |
|
|
|
tx.version = 1 |
|
|
|
wallet.sign_transaction(tx, password=None) |
|
|
|
|
|
|
|
self.assertTrue(tx.is_complete()) |
|
|
@ -895,6 +896,7 @@ class TestWalletSending(TestCaseForTestnet): |
|
|
|
# bump tx |
|
|
|
tx = wallet.bump_fee(tx=Transaction(tx.serialize()), delta=5000) |
|
|
|
tx.locktime = 1325501 |
|
|
|
tx.version = 1 |
|
|
|
self.assertFalse(tx.is_complete()) |
|
|
|
|
|
|
|
wallet.sign_transaction(tx, password=None) |
|
|
@ -925,6 +927,7 @@ class TestWalletSending(TestCaseForTestnet): |
|
|
|
tx = wallet.cpfp(funding_tx, fee=50000) |
|
|
|
tx.set_rbf(True) |
|
|
|
tx.locktime = 1325502 |
|
|
|
tx.version = 1 |
|
|
|
wallet.sign_transaction(tx, password=None) |
|
|
|
|
|
|
|
self.assertTrue(tx.is_complete()) |
|
|
@ -960,6 +963,7 @@ class TestWalletSending(TestCaseForTestnet): |
|
|
|
tx = wallet.make_unsigned_transaction(coins, outputs, config=self.config, fixed_fee=5000) |
|
|
|
tx.set_rbf(True) |
|
|
|
tx.locktime = 1325499 |
|
|
|
tx.version = 1 |
|
|
|
wallet.sign_transaction(tx, password=None) |
|
|
|
|
|
|
|
self.assertTrue(tx.is_complete()) |
|
|
@ -981,6 +985,7 @@ class TestWalletSending(TestCaseForTestnet): |
|
|
|
# bump tx |
|
|
|
tx = wallet.bump_fee(tx=Transaction(tx.serialize()), delta=5000) |
|
|
|
tx.locktime = 1325500 |
|
|
|
tx.version = 1 |
|
|
|
self.assertFalse(tx.is_complete()) |
|
|
|
|
|
|
|
wallet.sign_transaction(tx, password=None) |
|
|
@ -1011,6 +1016,7 @@ class TestWalletSending(TestCaseForTestnet): |
|
|
|
tx = wallet.cpfp(funding_tx, fee=50000) |
|
|
|
tx.set_rbf(True) |
|
|
|
tx.locktime = 1325501 |
|
|
|
tx.version = 1 |
|
|
|
wallet.sign_transaction(tx, password=None) |
|
|
|
|
|
|
|
self.assertTrue(tx.is_complete()) |
|
|
@ -1045,7 +1051,7 @@ class TestWalletSending(TestCaseForTestnet): |
|
|
|
privkeys = ['93NQ7CFbwTPyKDJLXe97jczw33fiLijam2SCZL3Uinz1NSbHrTu', ] |
|
|
|
network = NetworkMock() |
|
|
|
dest_addr = 'tb1q3ws2p0qjk5vrravv065xqlnkckvzcpclk79eu2' |
|
|
|
tx = sweep(privkeys, network, config=None, recipient=dest_addr, fee=5000, locktime=1325785) |
|
|
|
tx = sweep(privkeys, network, config=None, recipient=dest_addr, fee=5000, locktime=1325785, tx_version=1) |
|
|
|
|
|
|
|
tx_copy = Transaction(tx.serialize()) |
|
|
|
self.assertEqual('010000000129349e5641d79915e9d0282fdbaee8c3df0b6731bab9d70bf626e8588bde24ac010000004847304402206bf0d0a93abae0d5873a62ebf277a5dd2f33837821e8b93e74d04e19d71b578002201a6d729bc159941ef5c4c9e5fe13ece9fc544351ba531b00f68ba549c8b38a9a01fdffffff01b82e0f00000000001600148ba0a0bc12b51831f58c7ea8607e76c5982c071fd93a1400', |
|
|
@ -1090,6 +1096,7 @@ class TestWalletOfflineSigning(TestCaseForTestnet): |
|
|
|
tx = wallet_online.mktx(outputs=outputs, password=None, config=self.config, fee=5000) |
|
|
|
tx.set_rbf(True) |
|
|
|
tx.locktime = 1446655 |
|
|
|
tx.version = 1 |
|
|
|
|
|
|
|
self.assertFalse(tx.is_complete()) |
|
|
|
self.assertFalse(tx.is_segwit()) |
|
|
@ -1132,6 +1139,7 @@ class TestWalletOfflineSigning(TestCaseForTestnet): |
|
|
|
tx = wallet_online.mktx(outputs=outputs, password=None, config=self.config, fee=5000) |
|
|
|
tx.set_rbf(True) |
|
|
|
tx.locktime = 1325340 |
|
|
|
tx.version = 1 |
|
|
|
|
|
|
|
self.assertFalse(tx.is_complete()) |
|
|
|
self.assertFalse(tx.is_segwit()) |
|
|
@ -1172,6 +1180,7 @@ class TestWalletOfflineSigning(TestCaseForTestnet): |
|
|
|
tx = wallet_online.mktx(outputs=outputs, password=None, config=self.config, fee=5000) |
|
|
|
tx.set_rbf(True) |
|
|
|
tx.locktime = 1325341 |
|
|
|
tx.version = 1 |
|
|
|
|
|
|
|
self.assertFalse(tx.is_complete()) |
|
|
|
self.assertTrue(tx.is_segwit()) |
|
|
@ -1213,6 +1222,7 @@ class TestWalletOfflineSigning(TestCaseForTestnet): |
|
|
|
tx = wallet_online.mktx(outputs=outputs, password=None, config=self.config, fee=5000) |
|
|
|
tx.set_rbf(True) |
|
|
|
tx.locktime = 1325341 |
|
|
|
tx.version = 1 |
|
|
|
|
|
|
|
self.assertFalse(tx.is_complete()) |
|
|
|
self.assertTrue(tx.is_segwit()) |
|
|
@ -1249,6 +1259,7 @@ class TestWalletOfflineSigning(TestCaseForTestnet): |
|
|
|
tx = wallet_online.mktx(outputs=outputs, password=None, config=self.config, fee=5000) |
|
|
|
tx.set_rbf(True) |
|
|
|
tx.locktime = 1325340 |
|
|
|
tx.version = 1 |
|
|
|
|
|
|
|
self.assertFalse(tx.is_complete()) |
|
|
|
self.assertEqual(1, len(tx.inputs())) |
|
|
@ -1283,6 +1294,7 @@ class TestWalletOfflineSigning(TestCaseForTestnet): |
|
|
|
tx = wallet_online.mktx(outputs=outputs, password=None, config=self.config, fee=5000) |
|
|
|
tx.set_rbf(True) |
|
|
|
tx.locktime = 1325340 |
|
|
|
tx.version = 1 |
|
|
|
|
|
|
|
self.assertFalse(tx.is_complete()) |
|
|
|
self.assertEqual(1, len(tx.inputs())) |
|
|
@ -1317,6 +1329,7 @@ class TestWalletOfflineSigning(TestCaseForTestnet): |
|
|
|
tx = wallet_online.mktx(outputs=outputs, password=None, config=self.config, fee=5000) |
|
|
|
tx.set_rbf(True) |
|
|
|
tx.locktime = 1325340 |
|
|
|
tx.version = 1 |
|
|
|
|
|
|
|
self.assertFalse(tx.is_complete()) |
|
|
|
self.assertEqual(1, len(tx.inputs())) |
|
|
@ -1354,6 +1367,7 @@ class TestWalletOfflineSigning(TestCaseForTestnet): |
|
|
|
tx = wallet_online.mktx(outputs=outputs, password=None, config=self.config, fee=5000) |
|
|
|
tx.set_rbf(True) |
|
|
|
tx.locktime = 1325340 |
|
|
|
tx.version = 1 |
|
|
|
|
|
|
|
self.assertFalse(tx.is_complete()) |
|
|
|
self.assertEqual(1, len(tx.inputs())) |
|
|
@ -1391,6 +1405,7 @@ class TestWalletOfflineSigning(TestCaseForTestnet): |
|
|
|
tx = wallet_online.mktx(outputs=outputs, password=None, config=self.config, fee=5000) |
|
|
|
tx.set_rbf(True) |
|
|
|
tx.locktime = 1325340 |
|
|
|
tx.version = 1 |
|
|
|
|
|
|
|
self.assertFalse(tx.is_complete()) |
|
|
|
self.assertEqual(1, len(tx.inputs())) |
|
|
@ -1428,6 +1443,7 @@ class TestWalletOfflineSigning(TestCaseForTestnet): |
|
|
|
tx = wallet_online.mktx(outputs=outputs, password=None, config=self.config, fee=5000) |
|
|
|
tx.set_rbf(True) |
|
|
|
tx.locktime = 1325340 |
|
|
|
tx.version = 1 |
|
|
|
|
|
|
|
self.assertFalse(tx.is_complete()) |
|
|
|
self.assertEqual(1, len(tx.inputs())) |
|
|
@ -1477,6 +1493,7 @@ class TestWalletOfflineSigning(TestCaseForTestnet): |
|
|
|
tx = wallet_online.mktx(outputs=outputs, password=None, config=self.config, fee=5000) |
|
|
|
tx.set_rbf(True) |
|
|
|
tx.locktime = 1325503 |
|
|
|
tx.version = 1 |
|
|
|
|
|
|
|
self.assertFalse(tx.is_complete()) |
|
|
|
self.assertEqual(1, len(tx.inputs())) |
|
|
@ -1534,6 +1551,7 @@ class TestWalletOfflineSigning(TestCaseForTestnet): |
|
|
|
tx = wallet_online.mktx(outputs=outputs, password=None, config=self.config, fee=5000) |
|
|
|
tx.set_rbf(True) |
|
|
|
tx.locktime = 1325504 |
|
|
|
tx.version = 1 |
|
|
|
|
|
|
|
self.assertFalse(tx.is_complete()) |
|
|
|
self.assertEqual(1, len(tx.inputs())) |
|
|
@ -1593,6 +1611,7 @@ class TestWalletOfflineSigning(TestCaseForTestnet): |
|
|
|
tx = wallet_online.mktx(outputs=outputs, password=None, config=self.config, fee=5000) |
|
|
|
tx.set_rbf(True) |
|
|
|
tx.locktime = 1325505 |
|
|
|
tx.version = 1 |
|
|
|
|
|
|
|
self.assertFalse(tx.is_complete()) |
|
|
|
self.assertEqual(1, len(tx.inputs())) |
|
|
|