e93046c10b
MOVEONLY: Move signrawtransactionwithwallet test
...
Put signrawtransactionwithwallet_tests in rpc_signrawtransaction.py,
as the test is mainly testing the signrawtransaction RPC.
Review with `git show --color-moved=dimmed-zebra`
2022-05-30 16:25:17 +02:00
fd826130a0
rpc: move softfork info from getblockchaininfo to getdeploymentinfo
2022-01-15 04:37:56 +10:00
fac23c2114
scripted-diff: Bump copyright headers
...
The previous diff touched most files in ./test/, so bump the headers to
avoid having to touch them again for a bump later.
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./test/
-END VERIFY SCRIPT-
2021-11-10 11:10:24 +01:00
fa974f1f14
scripted-diff: Remove redundant sync_all and sync_blocks
...
The sync calls are redundant after a call to generate, because generate
already syncs itself.
-BEGIN VERIFY SCRIPT-
perl -0777 -pi -e 's/(generate[^\n]*\)[^\n]*)(\n|\s)+self.sync_(all|blocks)\([^\)]*\)\n/\1\n/g' $(git grep -l generate ./test)
-END VERIFY SCRIPT-
2021-11-10 11:10:15 +01:00
429b49378e
test: introduce script_util helper for creating P2PK scripts
2021-09-29 14:09:14 +02:00
fa4db8671b
test: Activate all regtest softforks at height 1, unless overridden
2021-09-16 18:53:04 +02:00
fa0b916971
scripted-diff: Use generate* from TestFramework
...
-BEGIN VERIFY SCRIPT-
sed --regexp-extended -i \
's/((self\.)?(nodes\[[^]]+\]|[a-z_]*(wallet|node)[0-9a-z_]*))\.(generate(|toaddress|block|todescriptor)(\(|, ))/self.\5\1, /g' \
$(git grep -l generate ./test | grep -v 'test_framework/' | grep -v 'feature_rbf')
-END VERIFY SCRIPT-
2021-09-02 10:34:35 +02:00
faf7e485e9
Set regtest.BIP65Height = 111 to speed up tests
2021-08-26 11:08:24 +02:00
fab2e23b57
Use generate* from TestFramework
...
The changes in feature_rbf can be reviewed with
--color-moved=dimmed-zebra --color-moved-ws=ignore-all-space
2021-08-19 19:02:11 +02:00
ca6c154ef1
test: refactor: remove hex_str_to_bytes
helper
...
Use the built-in class method bytes.fromhex() instead,
which is available since Python 3.0.
2021-08-01 19:26:51 +02:00
12f094ec21
test: use constants for CSV/CLTV activation heights in rpc_signrawtransaction
2021-07-27 00:14:57 +02:00
746f203f19
test: introduce generate_to_height
helper, use in rpc_signrawtransaction
...
This will speed up the test a bit and avoid potential .generate() RPC
timeouts (in sub-test `test_signing_with_cltv()`) on slower machines.
2021-07-27 00:14:52 +02:00
e3237b1cd0
test: check that CSV/CLTV are active in rpc_signrawtransaction
...
Without this check, the tests would also pass if the CSV and
CLTV activation heights are not reached yet (e.g. if the .generate()
calls before are removed), as the operations OP_CSV and OP_CLTV
simply behave as NOPs.
Also fixes a comment in the sub-test `test_signing_with_cltv()`.
2021-07-25 23:44:29 +02:00
905d672b74
test: use script_util helpers for creating P2W{PKH,SH} scripts
2021-07-05 20:40:52 +02:00
2ce7b47958
test: introduce tx_from_hex
helper for tx deserialization
...
`FromHex` is mostly used for transactions, so we introduce a
shortcut `tx_from_hex` for `FromHex(CTransaction, hex_str)`.
2021-06-21 14:28:05 +02:00
bfa9309ad6
Use COINBASE_MATURITY constant in functional tests.
2021-05-31 07:32:28 +02:00
a97a9298ce
Test that signrawtx works when a signed CSV and CLTV inputs are present
2021-03-04 21:54:34 -05:00
773c42b265
tests: Test that a fully signed tx given to signrawtx is unchanged
...
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.
2020-12-03 15:53:58 -05:00
0bd1860300
Avoid dumpprivkey and watchonly behavior in rpc_signrawtransaction.py
...
dumpprivkey and watchonly behavior don't work with descriptor wallets.
Test for multisigs is modified to not rely on watchonly behavior for
those multisigs. This has a side effect of removing listunspent, but
that's not the target of this test, so that's fine.
2020-11-01 17:54:19 -05:00
dca28634d7
test: ensure OP_1NEGATE satisfies BIP62 minimal push rule
...
with a regression test for PR 13084 and PR 17204.
2020-07-15 15:29:46 +12:00
fa488f131f
scripted-diff: Bump copyright headers
...
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./
-END VERIFY SCRIPT-
2020-04-16 13:33:09 -04:00
9cdddae3b4
test: add rpc_signrawtransaction logging
2020-04-12 12:12:03 +02:00
4d6cde38ce
test: refactor rpc_signrawtransaction witness script tests
...
to see what is distinct in each test.
2020-04-12 12:12:01 +02:00
fa2251df5e
test: Use one node to avoid a race due to missing sync in rpc_signrawtransaction
2020-04-07 02:19:08 +08:00
cd3b1569d9
Correctly compute redeemScript from witnessScript for signrawtransaction
...
ParsePrevouts uses GetScriptForWitness on the given witnessScript
to find the corresponding redeemScript. This is incorrect when the
witnessScript is either a P2PK or P2PKH script as it returns the
corresponding P2WPK script instead of turning the witnessScript
into a P2WSH script. Instead this should make the script a
WitnessV0ScriptHash destination and get the script for that.
Test cases are also added.
2020-03-31 18:41:52 -04:00
b6f9e3576a
test: re-enable CLI test support by using EncodeDecimal in json.dumps()
...
As mentioned in
https://github.com/bitcoin/bitcoin/pull/17675#issuecomment-563188648
2019-12-09 15:14:20 -05:00
993e38a4e2
tests: Mark functional tests not supporting bitcoin-cli (--usecli) as such
2019-12-06 14:40:28 +00:00
839c3f7c49
[rpc] Remove signrawtransaction warning
...
signrawtransaction was deprecated in 0.17 and removed in 0.18. A warning
was left in place to tell users to migrate to using
signrawtransactionswithwallet or signrawtransactionwithkey. Remove the
warning now that it's been two releases since the method was removed.
2019-03-22 10:30:25 -04:00
faa7cdf764
scripted-diff: Update copyright in ./test
...
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./test/
-END VERIFY SCRIPT-
2019-03-02 10:58:35 -05:00
fa6bf21f5e
scripted-diff: test: Use py3.5 bytes::hex() method
...
-BEGIN VERIFY SCRIPT-
sed -i -e "s/def bytes_to_hex_str/def b_2_x/g" $(git grep -l bytes_to_hex_str)
export RE_B_0="[^()]*" # match no bracket
export RE_B_1="${RE_B_0}\(${RE_B_0}\)${RE_B_0}" # match exactly one ()
export RE_B_2="${RE_B_0}\(${RE_B_1}\)${RE_B_0}" # match wrapped (())
export RE_M="(b2x|bytes_to_hex_str)\(((${RE_B_0}|${RE_B_1}|${RE_B_2})*)\)"
sed -i --regexp-extended -e "s/${RE_M}/\2.hex()/g" $(git grep -l -E '(b2x|bytes_to_hex_str)')
sed -i --regexp-extended -e "/ +bytes_to_hex_str( as b2x)?,/d" $(git grep -l bytes_to_hex_str)
sed -i --regexp-extended -e "s/ +bytes_to_hex_str( as b2x)?,//g" $(git grep -l bytes_to_hex_str)
sed -i --regexp-extended -e "s/, bytes_to_hex_str( as b2x)?//g" $(git grep -l bytes_to_hex_str)
export RE_M="(binascii\.)?hexlify\(((${RE_B_0}|${RE_B_1}|${RE_B_2})*)\).decode\(${RE_B_0}\)"
sed -i --regexp-extended -e "s/${RE_M}/\2.hex()/g" $(git grep -l hexlify -- ':(exclude)share')
sed -i --regexp-extended -e "/from binascii import hexlify$/d" $(git grep -l hexlify -- ':(exclude)share')
sed -i --regexp-extended -e "s/(from binascii import) .*hexlify/\1 unhexlify/g" $(git grep -l hexlify -- ':(exclude)share')
sed -i -e 's/ignore-names "/ignore-names "b_2_x,/g' ./test/lint/lint-python-dead-code.sh
-END VERIFY SCRIPT-
2019-03-02 10:40:12 -05:00
928beae007
Add test for P2SH-P2WSH in signrawtransactionwithkey and listunspent
2019-02-13 14:35:16 +13:00
20442f617f
[wallet] remove redundand restart node
2018-09-25 07:00:19 +01:00
db15805668
[wallet] Ensure wallet is unlocked before signing
2018-09-24 18:13:22 +01:00
fac9539836
qa: Run all tests even if wallet is not compiled
2018-09-10 17:53:21 -04:00
f7e9e70468
[rpc] Remove deprecated sigrawtransaction rpc method.
2018-08-27 14:36:12 -04:00
68400d8b96
tests: Use explicit imports
2018-08-13 14:13:39 +02:00
eb7daf4d60
Update copyright headers to 2018
2018-07-27 07:15:02 -04:00
d60234885b
Add test for signrawtransaction
...
Add a brief test for signrawtransaction to ensure that compatibility is maintained.
2018-02-17 11:42:01 -05:00
1e79c055cd
Split signrawtransaction into wallet and non-wallet
...
Splits signrwatransaction into a wallet version (signrawtransactionwithwallet) and
non-wallet version (signrawtransactionwithkey). signrawtransaction is marked as DEPRECATED
and will call the right signrawtransaction* command as per the parameters in order to
maintain compatibility.
Updated signrawtransactions test to use new RPCs
2018-02-17 11:42:00 -05:00
81b79f2c39
[tests] Rename rpc_* functional tests.
2018-01-25 09:44:29 +10:00