Convert selected tests to use named arguments in RPC calls. This covers a few of the important ones:
assumevalid.py
blockchain.py
merkle_blocks.py
segwit.py
As well as the test framework itself, util.py
.
This makes invocations easier to read especially if booleans or lots of arguments are involved.
Reviewing
To review I’d suggest using the command:
git diff --word-diff --word-diff-regex='[^[:space:],\(\)=]+'
This will regard the added argument names as one word, making it trivial to see what is added.
Process
As doing this is a bit of a finnicky process, I’m doing this a few tests at a time. I may add more to this PR later. In case people want to help, I created this list of RPC calls with argument names to avoid having to refer to the individual help all the time.
To make sure a test has no use of positional arguments left you can add these lines to __call__(self, *args, **argsn)
in authproxy.py
:
0 if args:
1 raise ValueError('TEST: supporting named arguments')
Every use of positional arguments will then raise that exception.