This can avoid bugs and makes the test code easier to read, because the order of positional args does not have to be known or assumed.
Also, contains two commits to remove dead code.
This can avoid bugs and makes the test code easier to read, because the order of positional args does not have to be known or assumed.
Also, contains two commits to remove dead code.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32360.
See the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
930@@ -931,8 +931,9 @@ def __init__(self, rpc):
931 def __getattr__(self, name):
932 return getattr(self.rpc, name)
933
934- def createwallet_passthrough(self, *args, **kwargs):
935- return self.__getattr__("createwallet")(*args, **kwargs)
936+ def rpc_passthrough(self, name, *args, **kwargs):
937+ """Directly pass through the RPC, avoiding any wrapped method."""
938+ return self.__getattr__(name)(*args, **kwargs)
avoiding any wrapped method.
Avoiding any of the below 4 wrapped methods?
add a more general (currently unused) method rpc_passthrough, which could be used in the future, if there really is need for it.
It seems to be effectively same as calling the instance returned by __getattr__
above, while improving readability. I don’t think it hurts to add this but I sense it will not end up being used if there are not already usages of it in the framework.
This can avoid bugs and makes the test code easier to read, because the
order of positional args does not have to be known or assumed.
48@@ -49,7 +49,7 @@ def invalid_label_name_test(self):
49 assert_equal(response[0]['error']['message'], "Invalid label name")
50
51 for rpc_call in rpc_calls:
52- assert_raises_rpc_error(-11, "Invalid label name", *rpc_call, "*")
53+ assert_raises_rpc_error(-11, "Invalid label name", *rpc_call, label="*")
RPCOverloadWrapper
class as well because those are present in rpc_calls
list, but after the positional args.
tACK fa48be3ba443d2436f754265b86331f84b866130
This pull makes the optional looking arguments as named args instead of being positional in the 4 wrapped methods of RPCOverloadWrapper
class in the functional test framework. I, too, have a preference for named args over positional as I feel it makes the function call sites easier on the eyes.
There are couple removals of unused fields and methods of RPCOverloadWrapper
class. Some formatting changes are also there that distracts a bit but are small enough to ignore.