Commit graph

105 commits

Author SHA1 Message Date
ivanlele
464433bd1b
Merge 81276540d3 into merged_master (Bitcoin PR bitcoin/bitcoin#30148) 2026-03-24 16:04:14 +00:00
ivanlele
aa41e29f97
Merge 3a29ff5dea into merged_master (Bitcoin PR bitcoin/bitcoin#30463) 2026-03-09 16:54:19 +00:00
ivanlele
4aef8053f4
Merge 1bcc91a52c into merged_master (Bitcoin PR bitcoin/bitcoin#29521) 2026-02-26 12:00:08 +00:00
Byron Hambly
c1b5207e8c
Merge d98d88c779 into merged_master (Bitcoin PR bitcoin/bitcoin#28392) 2025-08-07 09:16:33 +02:00
Byron Hambly
b4405ba453 Merge e9262ea32a into merged_master (Bitcoin PR bitcoin/bitcoin#26750) 2025-03-31 16:37:52 +02:00
Tom Trevethan
be69eb05cb Merge a4baf3f177 into merged_master (Bitcoin PR bitcoin/bitcoin#26628) 2025-03-27 09:46:31 +00:00
Byron Hambly
b735ecc00d Merge a63192afb8 into merged_master (Bitcoin PR bitcoin/bitcoin#19762) 2025-03-04 10:44:34 +02:00
Byron Hambly
0b0d5d214e Merge 8597260872 into merged_master (Bitcoin PR bitcoin/bitcoin#26480) 2025-03-04 10:42:21 +02:00
Ava Chow
81276540d3
Merge bitcoin/bitcoin#30148: cli: restrict multiple exclusive argument usage in bitcoin-cli
c8e6771af0 test: restrict multiple CLI arguments (naiyoma)
8838c4f171 common/args.h: automate check for multiple cli commands (naiyoma)

Pull request description:

  This PR is a continuation of the validation suggested [here](https://github.com/bitcoin/bitcoin/pull/27815) to ensure that only one Request Handler can be specified at a time.

ACKs for top commit:
  stratospher:
    reACK c8e6771.
  achow101:
    ACK c8e6771af0
  tdb3:
    cr re ACK c8e6771af0

Tree-SHA512: f4fe036fee342a54f1a7ac702ac35c40bf3d420fde6ab16313a75327292d5ee5c8ece1be9f852a13fcf73da1148b143b37b4894e294052abdde6eefb2e8c6f3f
2024-09-04 14:47:38 -04:00
naiyoma
c8e6771af0 test: restrict multiple CLI arguments 2024-08-06 14:55:30 +03:00
Hennadii Stepanov
a0473442d1
scripted-diff: Add __file__ argument to BitcoinTestFramework.init()
-BEGIN VERIFY SCRIPT-
sed -i -e 's/\s*().main\s*()/(__file__).main()/' $(git ls-files test/functional/*.py)
sed -i -e 's/def __init__(self)/def __init__(self, test_file)/' test/functional/test_framework/test_framework.py
-END VERIFY SCRIPT-
2024-07-16 22:06:47 +01:00
tdb3
e208fb5d3b
cli: Sanitize ports in rpcconnect and rpcport
Adds error handling of invalid ports to rpcconnect and rpcport,
with associated functional tests.
2024-05-13 12:14:04 -04:00
ns-xvrn
bfa0bd632a test: Use pathlib over os.path #28362
revert netutil chgs py3.8 compliant

fixes based on PR review
2023-10-10 09:26:56 -04:00
James Dorfman
e815e6ad8c Rename 'bitcoin-cli' -> 'elements-cli' in logging change introduced in the merge of bitcoin/bitcoin#23712 in 4c0504b349 2023-07-24 17:50:33 +00:00
Byron Hambly
87960114d8 Merge 2f26d8ec70 into merged_master (Bitcoin PR bitcoin/bitcoin#23725) 2023-06-12 12:36:20 +00:00
Byron Hambly
ca596d446a Merge 529ed33362 into merged_master (Bitcoin PR bitcoin/bitcoin#23715) 2023-06-06 10:18:36 +00:00
Byron Hambly
4c0504b349 Merge f727d814bd into merged_master (Bitcoin PR bitcoin/bitcoin#23712) 2023-06-06 09:46:12 +00:00
Byron Hambly
f936d6d2fa Merge 877f3aa85c into merged_master (Bitcoin PR bitcoin/bitcoin#23686) 2023-06-02 11:11:36 +00:00
Byron Hambly
bd68371fb6 Merge ffdab41f94 into merged_master (Bitcoin PR bitcoin/bitcoin#23474) 2023-05-26 10:32:04 +00:00
Byron Hambly
b951f8d198 Merge 8346004ac8 into merged_master (Bitcoin PR bitcoin/bitcoin#23077) 2023-05-17 12:13:27 +00:00
James Dorfman
0508c357e9 Merge d809d8bf12 into merged_master (Bitcoin PR bitcoin/bitcoin#22959) 2023-04-21 18:56:41 +00:00
James Dorfman
ae89c4bc51 Merge a5d00d4baf into merged_master (Bitcoin PR bitcoin/bitcoin#22788) 2023-04-21 04:02:55 +00:00
Byron Hambly
e7704c0b25 Merge 38975eccd4 into merged_master (Bitcoin PR bitcoin/bitcoin#22229) 2023-04-10 10:17:32 +00:00
Glenn Willen
72a0ba0291 Merge cac38cdd02 into merged_master (Bitcoin PR bitcoin/bitcoin#21832) 2023-03-21 03:59:44 +00:00
Hennadii Stepanov
306ccd4927
scripted-diff: Bump copyright headers
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./
-END VERIFY SCRIPT-

Commits of previous years:
- 2021: f47dda2c58
- 2020: fa0074e2d8
- 2019: aaaaad6ac9
2022-12-24 23:49:50 +00:00
Ryan Ofsky
d1ca563825 bitcoin-cli: Make it an error to specify the "args" parameter two different ways
MarcoFalke reported the case of positional arguments silently overwriting the
named "args" parameter in bitcoin-cli
https://github.com/bitcoin/bitcoin/pull/19762#discussion_r1035761471 and this
behavior is confusing and was not intended when support for "args" parameters
was added to bitcoin-cli in #19762.

Instead of letting one "args" value overwrite the other in the client, just
pass the values to the server verbatim, and let the error be handled server
side.
2022-12-02 17:53:58 -05:00
Ryan Ofsky
e2c3b18e67 test: Add RPC tests for same named parameter specified more than once
Current behavior isn't ideal and will be changed in upcoming commits, but it's
useful to have test coverage regardless.

MarcoFalke reported the case of bitcoin-cli positional arguments overwriting
the named "args" parameter in
https://github.com/bitcoin/bitcoin/pull/19762#discussion_r1035761471
2022-12-02 17:37:08 -05:00
Andrew Chow
a63192afb8
Merge bitcoin/bitcoin#19762: rpc: Allow named and positional arguments to be used together
d8b12a75db rpc: Allow named and positional arguments to be used together (Ryan Ofsky)

Pull request description:

  It's nice to be able to use named options and positional arguments together.

  Most shell tools accept both, and python functions combine options and arguments allowing them to be passed with even more flexibility. This change adds support for python's approach so as a motivating example:

  ```sh
  bitcoin-cli -named createwallet wallet_name=mywallet load_on_startup=1
  ```

  Can be shortened to:

  ```sh
  bitcoin-cli -named createwallet mywallet load_on_startup=1
  ```

  JSON-RPC standard doesn't have a convention for passing named and positional parameters together, so this implementation makes one up and interprets any unused `"args"` named parameter as a positional parameter array.

  This change is backwards compatible. It doesn't change the interpretation of any previously valid calls, just treats some previously invalid calls as valid.

  Another use case even if you only occasionally use named arguments is that you can define an alias:

  ```
  alias bcli='bitcoin-cli -named'
  ```

  And now use both named named and unnamed arguments from the same alias without having to manually add `-named` option for named arguments or see annoying error "No '=' in named argument... this needs to be present for every argument (even if it is empty)`" for unnamed arguments

ACKs for top commit:
  achow101:
    ACK d8b12a75db
  stickies-v:
    re-ACK d8b12a75d
  aureleoules:
    re-ACK d8b12a75db

Tree-SHA512: 0cff8b50f584bcbbd376624adccf40536566ed8d1bcd6c88ad565dbc208f19d5e7a48c994efd6329d42b560149340d330397278f08a2912af5f3418d8c8837a9
2022-11-29 18:37:55 -05:00
MacroFake
555519d082
test: Remove wallet option from non-wallet tests
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-10 17:19:13 +01:00
MacroFake
fa68937b89
test: Make requires_wallet private
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-11-10 10:01:31 +01:00
Ryan Ofsky
d8b12a75db rpc: Allow named and positional arguments to be used together
It's nice to be able to use named options and positional arguments together.

Most shell tools accept both, and python functions combine options and
arguments allowing them to be passed with even more flexibility. This change
adds support for python's approach so as a motivating example:

    bitcoin-cli -named createwallet wallet_name=mywallet load_on_startup=1

Can be shortened to:

    bitcoin-cli -named createwallet mywallet load_on_startup=1

JSON-RPC standard doesn't have a convention for passing named and positional
parameters together, so this implementation makes one up and interprets any
unused "args" named parameter as a positional parameter array.
2022-11-05 05:32:39 -04:00
Sebastian Falbesoner
50b044a88e test: fix test feature_coinstatsindex.py for descriptor wallets 2021-12-09 16:40:35 +01:00
Sebastian Falbesoner
84bc35d7a5 test: feature_rbf.py: check specified wallet type availability
The test currently leads to a failure if in general wallet
support is compiled, but the library for the specified type
(BDB/SQLite) is not, i.e.  if started with the
`--legacy-wallet` parameter, but bitcoind is compiled
without BDB support.

Fix this by checking if the specified wallet type (BDB for
legacy wallet, SQLite for descriptor wallet) is available.

Also move the helper `is_specified_wallet_compiled()` to the
test framework's class BitcoinTestFramework first, so it can
be reused.
2021-12-08 19:57:43 +01:00
Sebastian Falbesoner
b57bf25cfe test: interface_bitcoin_cli.py: check specified wallet type availability
Currently the test performs the wallet-relevant parts if
_any_ wallet type support is compiled in, independently of
whether the test is run with legacy or descriptor wallet
specified. This leads to a failure if the test is started
with the `--legacy-wallet` parameter, but bitcoind is
compiled without BDB support.

Fix this by checking if the specified wallet type (BDB for
legacy wallet, SQLite for descriptor wallet) is available.
2021-12-08 17:37:25 +01:00
Sebastian Falbesoner
e4fa28a322 test: fix test interface_bitcoin_cli.py for descriptor wallets 2021-12-06 20:13:06 +01:00
MarcoFalke
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
Vasil Dimov
e6890fcb44
net: don't skip CJDNS from GetNetworksInfo() 2021-11-03 14:58:49 +01:00
klementtan
7c3712fa32
cli: Display all proxies in -getinfo 2021-09-20 18:52:04 +08:00
MarcoFalke
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
fanquake
c2a5d560df
test: use f-strings in interface_*.py tests 2021-08-18 12:39:20 +08:00
Andrew Poelstra
a83d2595bc Merge 6556da77d7 into merged_master (Bitcoin PR bitcoin/bitcoin#21056) 2021-07-28 02:41:57 +00:00
Klement Tan
a37e29d32f
cli: Implement human readable -getinfo. 2021-07-21 19:27:04 +08:00
Andrew Poelstra
01b1d5f844 Merge c5ee0cc11a into merged_master (Bitcoin PR bitcoin/bitcoin#21989) 2021-07-19 13:07:08 +00:00
Andrew Poelstra
27eff4ad45 Merge d22e7ee933 into merged_master (Bitcoin PR bitcoin/bitcoin#21822)
Adding an iteration cap to a fuzztest in this PR, not because it
has anything to do with this PR, but because this is where the
merge script happened to be when I was done investigating 100+
minute fuzzer runs.

Added a comment explaining the rationale for the iteration cap.
2021-07-04 23:52:11 +00:00
Andrew Poelstra
bcd5f2207c Merge a6b1bf6439 into merged_master (Bitcoin PR #20267) 2021-06-21 02:52:43 +00:00
Christian Decker
b9e76f1bf0 rpc: Add test for -rpcwaittimeout
Suggested-by: Jon Atack <@jonatack>
2021-06-03 14:49:15 +02:00
Kiminuo
bfa9309ad6 Use COINBASE_MATURITY constant in functional tests. 2021-05-31 07:32:28 +02:00
klementtan
c5bb142817 test: resolve bug in test/functional/interface_bitcoin_cli.py - Test -getinfo with -rpcwallet=unloaded wallet returns no balances 2021-05-01 17:58:01 +08:00
Andrew Chow
4de23824b0 Setup wallets for interface_bitcoin_cli.py 2021-01-27 12:52:46 -05:00
Andrew Poelstra
62faba7499 Merge 171cd05ae3 into merged_master (Bitcoin PR #20034) 2020-11-30 05:33:57 +00:00