aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-12-04 16:03:21 +0100
committerMarcoFalke <falke.marco@gmail.com>2020-12-04 16:03:28 +0100
commit751ffaabad82f7904fd1d9742a0b323a0ab7bfee (patch)
treedcdc5a5f735b589b2d3a4a6a3757e83de53d8fae
parentc1604483d34f745fe6dc77a5f1be4fcfad7408a7 (diff)
parent773c42b265fb2212b5cb8785b7226a206d063543 (diff)
Merge #20562: tests: Test that a fully signed tx given to signrawtx is unchanged
773c42b265fb2212b5cb8785b7226a206d063543 tests: Test that a fully signed tx given to signrawtx is unchanged (Andrew Chow) Pull request description: Tests that a fully signed transaction given to `signrawtransactionwithwallet` is both unchanged and marked as complete. This tests for a regression in 0.20 where the transaction would not be marked as complete. ACKs for top commit: MarcoFalke: ACK 773c42b265 🕶 Tree-SHA512: b32afd5f2667c817ee59c37af78cb37352e7c22d0271833d446fd61f11b354974694128a3b408f214db459caef3fd67ecdbf1664280ac2de602215f05aa4a6de
-rwxr-xr-xtest/functional/rpc_signrawtransaction.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/functional/rpc_signrawtransaction.py b/test/functional/rpc_signrawtransaction.py
index b962e1c3a5..2fbbdbbdf0 100755
--- a/test/functional/rpc_signrawtransaction.py
+++ b/test/functional/rpc_signrawtransaction.py
@@ -151,6 +151,19 @@ class SignRawTransactionsTest(BitcoinTestFramework):
assert_equal(rawTxSigned['errors'][1]['witness'], ["304402203609e17b84f6a7d30c80bfa610b5b4542f32a8a0d5447a12fb1366d7f01cc44a0220573a954c4518331561406f90300e8f3358f51928d43c212a8caed02de67eebee01", "025476c2e83188368da1ff3e292e7acafcdb3566bb0ad253f62fc70f07aeee6357"])
assert not rawTxSigned['errors'][0]['witness']
+ def test_fully_signed_tx(self):
+ self.log.info("Test signing a fully signed transaction does nothing")
+ self.nodes[0].walletpassphrase("password", 9999)
+ self.nodes[0].generate(101)
+ rawtx = self.nodes[0].createrawtransaction([], [{self.nodes[0].getnewaddress(): 10}])
+ fundedtx = self.nodes[0].fundrawtransaction(rawtx)
+ signedtx = self.nodes[0].signrawtransactionwithwallet(fundedtx["hex"])
+ assert_equal(signedtx["complete"], True)
+ signedtx2 = self.nodes[0].signrawtransactionwithwallet(signedtx["hex"])
+ assert_equal(signedtx2["complete"], True)
+ assert_equal(signedtx["hex"], signedtx2["hex"])
+ self.nodes[0].walletlock()
+
def witness_script_test(self):
self.log.info("Test signing transaction to P2SH-P2WSH addresses without wallet")
# Create a new P2SH-P2WSH 1-of-1 multisig address:
@@ -231,6 +244,7 @@ class SignRawTransactionsTest(BitcoinTestFramework):
self.witness_script_test()
self.OP_1NEGATE_test()
self.test_with_lock_outputs()
+ self.test_fully_signed_tx()
if __name__ == '__main__':