Changeset View
Changeset View
Standalone View
Standalone View
test/lint/check-rpc-mappings.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
# Copyright (c) 2017-2018 The Bitcoin Core developers | # Copyright (c) 2017-2018 The Bitcoin Core developers | ||||
# Distributed under the MIT software license, see the accompanying | # Distributed under the MIT software license, see the accompanying | ||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php. | # file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
"""Check RPC argument consistency.""" | """Check RPC argument consistency.""" | ||||
from collections import defaultdict | from collections import defaultdict | ||||
import glob | import glob | ||||
import os | import os | ||||
import re | import re | ||||
import sys | import sys | ||||
# Source files (relative to root) to scan for dispatch tables | # Source files (relative to root) to scan for dispatch tables | ||||
SOURCE_PATTERNS = [ | SOURCE_PATTERNS = [ | ||||
"src/rpc/*.cpp", | "src/rpc/*.cpp", | ||||
"src/wallet/rpc*.cpp", | "src/wallet/rpc*.cpp", | ||||
"src/zmq/zmqrpc.cpp", | |||||
] | ] | ||||
# Source file (relative to root) containing conversion mapping | # Source file (relative to root) containing conversion mapping | ||||
SOURCE_CLIENT = 'src/rpc/client.cpp' | SOURCE_CLIENT = 'src/rpc/client.cpp' | ||||
# Argument names that should be ignored in consistency checks | # Argument names that should be ignored in consistency checks | ||||
IGNORE_DUMMY_ARGS = {'dummy', 'arg0', 'arg1', 'arg2', | IGNORE_DUMMY_ARGS = {'dummy', 'arg0', 'arg1', 'arg2', | ||||
'arg3', 'arg4', 'arg5', 'arg6', 'arg7', 'arg8', 'arg9'} | 'arg3', 'arg4', 'arg5', 'arg6', 'arg7', 'arg8', 'arg9'} | ||||
▲ Show 20 Lines • Show All 152 Lines • Show Last 20 Lines |