aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/interface_rest.py2
-rw-r--r--test/functional/test_framework/script.py5
-rwxr-xr-xtest/functional/test_framework/test_framework.py3
-rw-r--r--test/functional/test_framework/util.py4
-rw-r--r--test/functional/test_framework/wallet.py3
-rwxr-xr-xtest/functional/wallet_fast_rescan.py4
-rwxr-xr-xtest/lint/lint-files.py4
-rwxr-xr-xtest/lint/lint-include-guards.py3
8 files changed, 11 insertions, 17 deletions
diff --git a/test/functional/interface_rest.py b/test/functional/interface_rest.py
index c0679c5ba9..b81eae2506 100755
--- a/test/functional/interface_rest.py
+++ b/test/functional/interface_rest.py
@@ -65,7 +65,7 @@ class RESTTest (BitcoinTestFramework):
body: str = '',
status: int = 200,
ret_type: RetType = RetType.JSON,
- query_params: Optional[typing.Dict[str, typing.Any]] = None,
+ query_params: Optional[dict[str, typing.Any]] = None,
) -> typing.Union[http.client.HTTPResponse, bytes, str, None]:
rest_uri = '/rest' + uri
if req_type in ReqType:
diff --git a/test/functional/test_framework/script.py b/test/functional/test_framework/script.py
index 17a954cb22..b3d55158ec 100644
--- a/test/functional/test_framework/script.py
+++ b/test/functional/test_framework/script.py
@@ -10,7 +10,6 @@ This file is modified from python-bitcoinlib.
from collections import namedtuple
import struct
import unittest
-from typing import List, Dict
from .key import TaggedHash, tweak_add_pubkey, compute_xonly_pubkey
@@ -110,8 +109,8 @@ class CScriptOp(int):
_opcode_instances.append(super().__new__(cls, n))
return _opcode_instances[n]
-OPCODE_NAMES: Dict[CScriptOp, str] = {}
-_opcode_instances: List[CScriptOp] = []
+OPCODE_NAMES: dict[CScriptOp, str] = {}
+_opcode_instances: list[CScriptOp] = []
# Populate opcode instance table
for n in range(0xff + 1):
diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py
index 4e6d245b5f..e182eb0e99 100755
--- a/test/functional/test_framework/test_framework.py
+++ b/test/functional/test_framework/test_framework.py
@@ -19,7 +19,6 @@ import sys
import tempfile
import time
-from typing import List
from .address import create_deterministic_address_bcrt1_p2tr_op_true
from .authproxy import JSONRPCException
from . import coverage
@@ -96,7 +95,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
"""Sets test framework defaults. Do not override this method. Instead, override the set_test_params() method"""
self.chain: str = 'regtest'
self.setup_clean_chain: bool = False
- self.nodes: List[TestNode] = []
+ self.nodes: list[TestNode] = []
self.extra_args = None
self.network_thread = None
self.rpc_timeout = 60 # Wait for up to 60 seconds for the RPC server to respond
diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py
index 96d70b7380..8ee1ef7008 100644
--- a/test/functional/test_framework/util.py
+++ b/test/functional/test_framework/util.py
@@ -20,7 +20,7 @@ import time
from . import coverage
from .authproxy import AuthServiceProxy, JSONRPCException
-from typing import Callable, Optional, Tuple
+from typing import Callable, Optional
logger = logging.getLogger("TestFramework.utils")
@@ -416,7 +416,7 @@ def get_datadir_path(dirname, n):
return pathlib.Path(dirname) / f"node{n}"
-def get_temp_default_datadir(temp_dir: pathlib.Path) -> Tuple[dict, pathlib.Path]:
+def get_temp_default_datadir(temp_dir: pathlib.Path) -> tuple[dict, pathlib.Path]:
"""Return os-specific environment variables that can be set to make the
GetDefaultDataDir() function return a datadir path under the provided
temp_dir, as well as the complete path it would return."""
diff --git a/test/functional/test_framework/wallet.py b/test/functional/test_framework/wallet.py
index 035a482f4c..53c8e1b0cc 100644
--- a/test/functional/test_framework/wallet.py
+++ b/test/functional/test_framework/wallet.py
@@ -9,7 +9,6 @@ from decimal import Decimal
from enum import Enum
from typing import (
Any,
- List,
Optional,
)
from test_framework.address import (
@@ -284,7 +283,7 @@ class MiniWallet:
def create_self_transfer_multi(
self,
*,
- utxos_to_spend: Optional[List[dict]] = None,
+ utxos_to_spend: Optional[list[dict]] = None,
num_outputs=1,
amount_per_output=0,
locktime=0,
diff --git a/test/functional/wallet_fast_rescan.py b/test/functional/wallet_fast_rescan.py
index 2f9c924e71..1315bccafd 100755
--- a/test/functional/wallet_fast_rescan.py
+++ b/test/functional/wallet_fast_rescan.py
@@ -4,8 +4,6 @@
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test that fast rescan using block filters for descriptor wallets detects
top-ups correctly and finds the same transactions than the slow variant."""
-from typing import List
-
from test_framework.address import address_to_scriptpubkey
from test_framework.descriptors import descsum_create
from test_framework.test_framework import BitcoinTestFramework
@@ -32,7 +30,7 @@ class WalletFastRescanTest(BitcoinTestFramework):
self.skip_if_no_wallet()
self.skip_if_no_sqlite()
- def get_wallet_txids(self, node: TestNode, wallet_name: str) -> List[str]:
+ def get_wallet_txids(self, node: TestNode, wallet_name: str) -> list[str]:
w = node.get_wallet_rpc(wallet_name)
txs = w.listtransactions('*', 1000000)
return [tx['txid'] for tx in txs]
diff --git a/test/lint/lint-files.py b/test/lint/lint-files.py
index f2b5db681b..86fe727b06 100755
--- a/test/lint/lint-files.py
+++ b/test/lint/lint-files.py
@@ -11,7 +11,7 @@ import os
import re
import sys
from subprocess import check_output
-from typing import Dict, Optional, NoReturn
+from typing import Optional, NoReturn
CMD_TOP_LEVEL = ["git", "rev-parse", "--show-toplevel"]
CMD_ALL_FILES = ["git", "ls-files", "-z", "--full-name", "--stage"]
@@ -69,7 +69,7 @@ class FileMeta(object):
return None
-def get_git_file_metadata() -> Dict[str, FileMeta]:
+def get_git_file_metadata() -> dict[str, FileMeta]:
'''
Return a dictionary mapping the name of all files in the repository to git tree metadata.
'''
diff --git a/test/lint/lint-include-guards.py b/test/lint/lint-include-guards.py
index 48b918e9da..291e528c1d 100755
--- a/test/lint/lint-include-guards.py
+++ b/test/lint/lint-include-guards.py
@@ -11,7 +11,6 @@ Check include guards.
import re
import sys
from subprocess import check_output
-from typing import List
HEADER_ID_PREFIX = 'BITCOIN_'
@@ -28,7 +27,7 @@ EXCLUDE_FILES_WITH_PREFIX = ['contrib/devtools/bitcoin-tidy',
'src/test/fuzz/FuzzedDataProvider.h']
-def _get_header_file_lst() -> List[str]:
+def _get_header_file_lst() -> list[str]:
""" Helper function to get a list of header filepaths to be
checked for include guards.
"""