aboutsummaryrefslogtreecommitdiff
path: root/test/functional/rpc_createmultisig.py
AgeCommit message (Collapse)Author
2023-06-29Merge bitcoin/bitcoin#27884: test: Use TestNode datadir_path or chain_path ↵fanquake
where possible aaaa3aefbdfca1c9243057eeefdc19940e60bf18 test: Use TestNode *_path properties where possible (MarcoFalke) dddd89962b26b5593860d016586ee8feb5aeea24 test: Allow pathlib.Path as RPC argument via authproxy (MarcoFalke) fa41614a0abc05cbfbf76d6af3a186ab8d79c3f2 scripted-diff: Use wallets_path and chain_path where possible (MarcoFalke) fa493fadfb0ac73b7c0ee308f6623213702ae6f4 test: Use wallet_dir lambda in wallet_multiwallet test where possible (MarcoFalke) Pull request description: It seems inconsistent, fragile and verbose to: * Call `get_datadir_path` to recreate the path that already exists as field in TestNode * Call `os.path.join` with the hardcoded chain name or `self.chain` to recreate the TestNode `chain_path` property * Sometimes even use the hardcoded node dir name (`"node0"`) Fix all issues by using the TestNode properties. ACKs for top commit: willcl-ark: re-ACK aaaa3aefbdfca1c9243057eeefdc19940e60bf18 theStack: Code-review ACK aaaa3aefbdfca1c9243057eeefdc19940e60bf18 🌊 Tree-SHA512: e4720278085beb8164e1fe6c1aa18f601558a9263494ce69a83764c1487007de63ebb51d1b1151862dc4d5b49ded6162a5c1553cd30ea1c28627d447db4d8e72
2023-06-21test: Use TestNode *_path properties where possibleMarcoFalke
Seems odd to place the burden on test writers to hardcode the chain or datadir path for the nodes under test.
2023-06-19test: refactor: introduce `generate_keypair` helper with WIF supportSebastian Falbesoner
In functional tests it is a quite common scenario to generate fresh elliptic curve keypairs, which is currently a bit cumbersome as it involves multiple steps, e.g.: privkey = ECKey() privkey.generate() privkey_wif = bytes_to_wif(privkey.get_bytes()) pubkey = privkey.get_pubkey().get_bytes() Simplify this by providing a new `generate_keypair` helper function that returns the private key either as `ECKey` object or as WIF-string (depending on the boolean `wif` parameter) and the public key as byte-string; these formats are what we mostly need (currently we don't use `ECPubKey` objects from generated keypairs anywhere). With this, most of the affected code blocks following the pattern above can be replaced by one-liners, e.g.: privkey, pubkey = generate_keypair(wif=True) Note that after this commit, the only direct uses of `ECKey` remain in situations where we want to set the private key explicitly, e.g. in MiniWallet (test/functional/test_framework/wallet.py) or the test for the signet miner script (test/functional/tool_signet_miner.py).
2023-05-12test: Return dict in MiniWallet::send_toMarcoFalke
2023-03-28refactor: use address_to_scriptpubkey to retrieve addresses scriptpubkeyismaelsadeeq
This commit updates the code by replacing the RPC call used to decode an address and retrieve its corresponding scriptpubkey with the address_to_scriptpubkey function. address_to_scriptpubkey function can now decode all addresses formats, which makes it more efficient to use.
2022-12-24scripted-diff: Bump copyright headersHennadii Stepanov
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT- Commits of previous years: - 2021: f47dda2c58b5d8d623e0e7ff4e74bc352dfa83d7 - 2020: fa0074e2d82928016a43ca408717154a1c70a4db - 2019: aaaaad6ac95b402fe18d019d67897ced6b316ee0
2022-11-10test: Remove wallet option from non-wallet testsMacroFake
Review note: The changes are complete, because self.options.descriptors is set to None in parse_args (test_framework.py). A value of None implies -disablewallet, see the previous commit. So if a call to add_wallet_options is missing, it will lead to a test failure when the wallet is compiled in.
2022-11-10test: Make requires_wallet privateMacroFake
The bool is only used to call a public helper, which some tests already do. So use the public helper in all tests consistently and make the confusingly named bool private.
2022-06-14test: implement 'bech32m' mode for `getnewdestination()` helperSebastian Falbesoner
2022-06-06test: ensure createmultisig and addmultisigaddress are not returning any ↵brunoerg
warning for expected cases
2022-03-22test: use MiniWallet for rpc_createmultisig.pyAyush Sharma
This test can now be run even with the Bitcoin Core wallet disabled.
2021-12-08Add warnings field to addmultisigaddress to warn about uncompressed keysSamuel Dobson
2021-12-08Add warnings field to createmultisig to warn about uncompressed keysSamuel Dobson
2021-11-10scripted-diff: Bump copyright headersMarcoFalke
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-10scripted-diff: Remove redundant sync_all and sync_blocksMarcoFalke
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-09-02scripted-diff: Use generate* from TestFrameworkMarcoFalke
-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-08-04test: refactor: remove binascii from test_frameworkZero-1729
2021-06-22Disallow bech32m addresses for legacy wallet thingsAndrew Chow
We don't want the legacy wallet to ever have bech32m addresses so don't allow importing them. This includes addmultisigaddress as that is a legacy wallet only RPC Additionally, bech32m multisigs are not available yet, so disallow them in createmultisig.
2021-05-31Use COINBASE_MATURITY constant in functional tests.Kiminuo
2021-03-23rpc: deprecate `addresses` and `reqSigs` from rpc outputsMichael Dietz
1) add a new sane "address" field (for outputs that have an identifiable address, which doesn't include bare multisig) 2) with -deprecatedrpc: leave "reqSigs" and "addresses" intact (with all weird/wrong behavior they have now) 3) without -deprecatedrpc: drop "reqSigs" and "addresses" entirely, always.
2020-12-31scripted-diff: Bump copyright headersMarcoFalke
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
2020-09-03wallet: Remove path checking code from loadwallet RPCRussell Yanofsky
This commit does not change behavior except for error messages which now include more complete information.
2020-06-10[tests] move generate_wif_key to wallet_util.pyJohn Newbery
generate_wif_key is a wallet utility function. Move it from the EC key module to the wallet util module.
2020-06-10[tests] sort imports in rpc_createmultisig.pyJohn Newbery
2020-04-23Add a --descriptors option to various testsAndrew Chow
Adds a --descriptors option globally to the test framework. This will make the test create and use descriptor wallets. However some tests may not work with this. Some tests are modified to work with --descriptors and run with that option in test_runer: * wallet_basic.py * wallet_encryption.py * wallet_keypool.py * wallet_keypool_topup.py * wallet_labels.py * wallet_avoidreuse.py
2020-01-30Output a descriptor in createmultisig and addmultisigaddressAndrew Chow
2019-12-06tests: Mark functional tests not supporting bitcoin-cli (--usecli) as suchpracticalswift
2019-10-08Test sortedmulti descriptor using BIP 67 testsAndrew Chow
2019-09-10signrawtransactionwithkey: better error messages for bad ↵Anthony Towns
redeemScript/witnessScript This adds checks to ensure the redeemScript/witnessScript actually correspond to the provided scriptPubKey, and, if both are provided, that they are sensibly related to each other. Thanks to github user passionofvc for raising this issue.
2019-07-02Merge #16250: signrawtransactionwithkey: report error when missing ↵MarcoFalke
redeemScript/witnessScript 01174596e69568c434198a86f54cb9ea6740e6c2 signrawtransactionwithkey: report error when missing redeemScript/witnessScript param (Anthony Towns) Pull request description: Adding support for "witnessScript" as an alternative to "redeemScript" when using "signrawtransactionwithkey" meant that the `RPCTypeCheckObj()` call in `SignTransaction` can't error out just because either parameter is missing -- it's only a problem if both are missing, which isn't a state `RPCTypeCheckObj()` tests for. This results in the regression described in #16249. This patch adds some code to test for this case and give a similar error, namely: error code: -8 error message: Missing redeemScript/witnessScript Fixes: #16249 ACKs for top commit: meshcollider: utACK https://github.com/bitcoin/bitcoin/pull/16250/commits/01174596e69568c434198a86f54cb9ea6740e6c2 promag: ACK 01174596e. Could also write test without `dict`/`del`: Tree-SHA512: cf51346b7dea551b7f18f2a93c2a336a293b2535c62c03a5263cd2be8c58cf0cc302891da659c167e88ad1a68a756472c3c07e99f71627c61d32886fc5a3a353
2019-06-25signrawtransactionwithkey: report error when missing ↵Anthony Towns
redeemScript/witnessScript param
2019-06-20Make and get the multisig redeemscript and destination in one function ↵Andrew Chow
instead of two Instead of creating a redeemScript with CreateMultisigRedeemscript and then getting the destination with AddAndGetDestinationForScript, do both in the same function. CreateMultisigRedeemscript is changed to AddAndGetMultisigDestination. It creates the redeemScript and returns it via an output parameter. Then it calls AddAndGetDestinationForScript to add the destination to the keystore and get the proper destination. This allows us to inspect the public keys in the redeemScript before creating the destination so that the correct destination is used when uncompressed pubkeys are in the multisig.
2019-04-17test: Add test that addmultisigaddress fails for watchonly addressesMarcoFalke
2019-04-16test: Fixup creatmultisig documentation and whitespaceMarcoFalke
2019-03-14wallet/rpc: add maxfeerate parameter to sendrawtransactionKarl-Johan Alm
2018-09-10qa: Run all tests even if wallet is not compiledMarcoFalke
2018-07-27Update copyright headers to 2018DrahtBot
2018-07-10[tests] functional test for createmultisig RPCAnthony Towns