Page MenuHomePhabricator

D13193.diff
No OneTemporary

D13193.diff

diff --git a/test/functional/abc_feature_proof_cleanup.py b/test/functional/abc_feature_proof_cleanup.py
--- a/test/functional/abc_feature_proof_cleanup.py
+++ b/test/functional/abc_feature_proof_cleanup.py
@@ -46,8 +46,8 @@
master_key, local_proof = gen_proof(self, node)
self.restart_node(0, self.extra_args[0] + [
- "-avaproof={}".format(local_proof.serialize().hex()),
- "-avamasterkey={}".format(bytes_to_wif(master_key.get_bytes())),
+ f"-avaproof={local_proof.serialize().hex()}",
+ f"-avamasterkey={bytes_to_wif(master_key.get_bytes())}",
])
# Add an inbound so the node proof can be registered and advertised
node.add_p2p_connection(P2PInterface())
@@ -91,7 +91,7 @@
# Run the cleanup, the proofs with no node are cleaned excepted our
# local proof
- with node.assert_debug_log(["Proof dropped for dangling too long (no connected node): {}".format(uint256_hex(p.proofid)) for p in proofs[6:]]):
+ with node.assert_debug_log([f"Proof dropped for dangling too long (no connected node): {uint256_hex(p.proofid)}" for p in proofs[6:]]):
# Expire the dangling proof timeout
mocktime += 1
node.setmocktime(mocktime)
diff --git a/test/functional/abc_mining_basic.py b/test/functional/abc_mining_basic.py
--- a/test/functional/abc_mining_basic.py
+++ b/test/functional/abc_mining_basic.py
@@ -26,13 +26,11 @@
self.extra_args = [
[
'-enableminerfund',
- '-wellingtonactivationtime={}'.format(
- WELLINGTON_ACTIVATION_TIME),
+ f'-wellingtonactivationtime={WELLINGTON_ACTIVATION_TIME}',
], [
'-enableminerfund',
'-usecashaddr=0',
- '-wellingtonactivationtime={}'.format(
- WELLINGTON_ACTIVATION_TIME),
+ f'-wellingtonactivationtime={WELLINGTON_ACTIVATION_TIME}',
],
]
diff --git a/test/functional/abc_p2p_avalanche_peer_discovery.py b/test/functional/abc_p2p_avalanche_peer_discovery.py
--- a/test/functional/abc_p2p_avalanche_peer_discovery.py
+++ b/test/functional/abc_p2p_avalanche_peer_discovery.py
@@ -140,7 +140,7 @@
# Restart the node
self.restart_node(0, self.extra_args[0] + [
- "-avaproof={}".format(proof),
+ f"-avaproof={proof}",
"-avamasterkey=cND2ZvtabDbJ1gucx9GWH6XT9kgTAqfb6cotPt5Q5CyxVDhid2EN",
])
@@ -164,15 +164,15 @@
self.log.info(
"Test the avahello signature with a generated delegation")
check_avahello([
- "-avaproof={}".format(proof),
+ f"-avaproof={proof}",
"-avamasterkey=cND2ZvtabDbJ1gucx9GWH6XT9kgTAqfb6cotPt5Q5CyxVDhid2EN"
])
self.log.info("Test the avahello signature with a supplied delegation")
check_avahello([
- "-avaproof={}".format(proof),
- "-avadelegation={}".format(delegation),
- "-avamasterkey={}".format(bytes_to_wif(master_key.get_bytes())),
+ f"-avaproof={proof}",
+ f"-avadelegation={delegation}",
+ f"-avamasterkey={bytes_to_wif(master_key.get_bytes())}",
])
stakes = create_coinbase_stakes(node, [blockhashes[1]], addrkey0.key)
@@ -234,7 +234,7 @@
# Restart the node
self.restart_node(0, self.extra_args[0] + [
- "-avaproof={}".format(proof),
+ f"-avaproof={proof}",
"-avamasterkey=cND2ZvtabDbJ1gucx9GWH6XT9kgTAqfb6cotPt5Q5CyxVDhid2EN",
])
@@ -280,7 +280,7 @@
# Restart the node
self.restart_node(0, self.extra_args[0] + [
- "-avaproof={}".format(proof),
+ f"-avaproof={proof}",
"-avamasterkey=cND2ZvtabDbJ1gucx9GWH6XT9kgTAqfb6cotPt5Q5CyxVDhid2EN",
])
wait_for_proof_validation()
@@ -351,9 +351,9 @@
"Check the node waits for inbound connection to advertise its proof")
self.restart_node(0, self.extra_args[0] + [
- "-avaproof={}".format(proof),
- "-avadelegation={}".format(delegation),
- "-avamasterkey={}".format(bytes_to_wif(master_key.get_bytes())),
+ f"-avaproof={proof}",
+ f"-avadelegation={delegation}",
+ f"-avamasterkey={bytes_to_wif(master_key.get_bytes())}",
])
outbound = AvaP2PInterface()
diff --git a/test/functional/abc_p2p_avalanche_voting.py b/test/functional/abc_p2p_avalanche_voting.py
--- a/test/functional/abc_p2p_avalanche_voting.py
+++ b/test/functional/abc_p2p_avalanche_voting.py
@@ -302,7 +302,7 @@
# Try some longer fork chains
for numblocks in range(2, len(ADDRS)):
- self.log.info("...for a chain {} blocks long...".format(numblocks))
+ self.log.info(f"...for a chain {numblocks} blocks long...")
# Create a new fork N blocks deep
fork_node.invalidateblock(chain_head)
diff --git a/test/functional/abc_p2p_compactblocks.py b/test/functional/abc_p2p_compactblocks.py
--- a/test/functional/abc_p2p_compactblocks.py
+++ b/test/functional/abc_p2p_compactblocks.py
@@ -92,8 +92,7 @@
'-limitdescendantcount=999999',
'-limitdescendantsize=999999',
'-maxmempool=99999',
- '-excessiveblocksize={}'.format(
- self.excessive_block_size),
+ f'-excessiveblocksize={self.excessive_block_size}',
'-acceptnonstdtxn=1']]
# UBSAN will cause this test to timeout without this.
self.rpc_timeout = 180
diff --git a/test/functional/abc_p2p_compactproofs.py b/test/functional/abc_p2p_compactproofs.py
--- a/test/functional/abc_p2p_compactproofs.py
+++ b/test/functional/abc_p2p_compactproofs.py
@@ -209,7 +209,7 @@
added_node_info) == 1 and added_node_info[0]['connected']
def connect_callback(address, port):
- self.log.debug("Connecting to {}:{}".format(address, port))
+ self.log.debug(f"Connecting to {address}:{port}")
p = AvaP2PInterface(self, node)
p2p_idx = 1
diff --git a/test/functional/abc_p2p_fullblocktest.py b/test/functional/abc_p2p_fullblocktest.py
--- a/test/functional/abc_p2p_fullblocktest.py
+++ b/test/functional/abc_p2p_fullblocktest.py
@@ -53,7 +53,7 @@
self.blocks = {}
self.excessive_block_size = 100 * ONE_MEGABYTE
self.extra_args = [['-whitelist=noban@127.0.0.1',
- "-excessiveblocksize={}".format(self.excessive_block_size)]]
+ f"-excessiveblocksize={self.excessive_block_size}"]]
self.supports_cli = False
# The default timeout is not enough when submitting large blocks with
# TSAN enabled
diff --git a/test/functional/abc_p2p_getavaaddr.py b/test/functional/abc_p2p_getavaaddr.py
--- a/test/functional/abc_p2p_getavaaddr.py
+++ b/test/functional/abc_p2p_getavaaddr.py
@@ -295,7 +295,7 @@
added_node_info) == 1 and added_node_info[0]['connected']
def connect_callback(address, port):
- self.log.debug("Connecting to {}:{}".format(address, port))
+ self.log.debug(f"Connecting to {address}:{port}")
p = AvaP2PInterface()
p2p_idx = 1
diff --git a/test/functional/abc_p2p_proof_inventory.py b/test/functional/abc_p2p_proof_inventory.py
--- a/test/functional/abc_p2p_proof_inventory.py
+++ b/test/functional/abc_p2p_proof_inventory.py
@@ -181,8 +181,8 @@
for node in nodes:
privkey, proof = proofs_keys[node.index]
self.restart_node(node.index, self.extra_args[node.index] + [
- "-avaproof={}".format(proof.serialize().hex()),
- "-avamasterkey={}".format(bytes_to_wif(privkey.get_bytes()))
+ f"-avaproof={proof.serialize().hex()}",
+ f"-avamasterkey={bytes_to_wif(privkey.get_bytes())}"
] + (extra_args or []))
restart_nodes_with_proof(self.nodes[:-1])
diff --git a/test/functional/abc_rpc_avalancheproof.py b/test/functional/abc_rpc_avalancheproof.py
--- a/test/functional/abc_rpc_avalancheproof.py
+++ b/test/functional/abc_rpc_avalancheproof.py
@@ -58,7 +58,7 @@
self.setup_clean_chain = True
self.num_nodes = 2
self.extra_args = [[
- '-avaproofstakeutxodustthreshold={}'.format(PROOF_DUST_THRESHOLD),
+ f'-avaproofstakeutxodustthreshold={PROOF_DUST_THRESHOLD}',
'-avaproofstakeutxoconfirmations=1',
'-avalancheconflictingproofcooldown=0',
'-avacooldown=0',
@@ -169,7 +169,7 @@
# Restart the node with this proof
self.restart_node(0, self.extra_args[0] + [
- "-avaproof={}".format(proof),
+ f"-avaproof={proof}",
"-avamasterkey=cND2ZvtabDbJ1gucx9GWH6XT9kgTAqfb6cotPt5Q5CyxVDhid2EN",
])
@@ -192,8 +192,8 @@
stake_age = node.getblockcount() + 2
self.restart_node(1, self.extra_args[0] + [
- "-avaproofstakeutxoconfirmations={}".format(stake_age),
- "-avaproof={}".format(proof),
+ f"-avaproofstakeutxoconfirmations={stake_age}",
+ f"-avaproof={proof}",
"-avamasterkey=cND2ZvtabDbJ1gucx9GWH6XT9kgTAqfb6cotPt5Q5CyxVDhid2EN",
])
@@ -430,7 +430,7 @@
rpc, "f00d")
def check_rpc_failure(proof, message):
- assert_raises_rpc_error(-8, "The proof is invalid: " + message,
+ assert_raises_rpc_error(-8, f"The proof is invalid: {message}",
rpc, proof)
check_rpc_failure(no_stake, "no-stake")
@@ -451,7 +451,7 @@
# Clear the proof pool
stake_age = node.getblockcount()
self.restart_node(0, self.extra_args[0] + [
- "-avaproofstakeutxoconfirmations={}".format(stake_age),
+ f"-avaproofstakeutxoconfirmations={stake_age}",
'-avalancheconflictingproofcooldown=0'
])
@@ -538,14 +538,14 @@
node.assert_start_raises_init_error(
self.extra_args[0] + [
- "-avaproof={}".format(proof),
+ f"-avaproof={proof}",
],
expected_msg="Error: The avalanche master key is missing for the avalanche proof.",
)
node.assert_start_raises_init_error(
self.extra_args[0] + [
- "-avaproof={}".format(proof),
+ f"-avaproof={proof}",
"-avamasterkey=0",
],
expected_msg="Error: The avalanche master key is invalid.",
@@ -554,10 +554,10 @@
def check_proof_init_error(proof, message):
node.assert_start_raises_init_error(
self.extra_args[0] + [
- "-avaproof={}".format(proof),
+ f"-avaproof={proof}",
"-avamasterkey=cND2ZvtabDbJ1gucx9GWH6XT9kgTAqfb6cotPt5Q5CyxVDhid2EN",
],
- expected_msg="Error: " + message,
+ expected_msg=f"Error: {message}",
)
check_proof_init_error(no_stake,
@@ -573,7 +573,7 @@
if self.is_wallet_compiled():
# The too many utxos case creates a proof which is that large that it
# cannot fit on the command line
- append_config(node.datadir, ["avaproof={}".format(too_many_utxos)])
+ append_config(node.datadir, [f"avaproof={too_many_utxos}"])
node.assert_start_raises_init_error(
self.extra_args[0] + [
"-avamasterkey=cND2ZvtabDbJ1gucx9GWH6XT9kgTAqfb6cotPt5Q5CyxVDhid2EN",
@@ -587,9 +587,8 @@
random_privkey.generate()
node.assert_start_raises_init_error(
self.extra_args[0] + [
- "-avaproof={}".format(proof),
- "-avamasterkey={}".format(
- bytes_to_wif(random_privkey.get_bytes())),
+ f"-avaproof={proof}",
+ f"-avamasterkey={bytes_to_wif(random_privkey.get_bytes())}",
],
expected_msg="Error: The master key does not match the proof public key.",
)
@@ -599,15 +598,13 @@
def check_delegation_init_error(delegation, message):
node.assert_start_raises_init_error(
self.extra_args[0] + [
- "-avadelegation={}".format(delegation),
- "-avaproof={}".format(proof),
- "-avamasterkey={}".format(
- bytes_to_wif(delegated_privkey.get_bytes())),
+ f"-avadelegation={delegation}",
+ f"-avaproof={proof}",
+ f"-avamasterkey={bytes_to_wif(delegated_privkey.get_bytes())}",
# Prevent the node from adding a delegation level
- "-avasessionkey={}".format(
- bytes_to_wif(delegated_privkey.get_bytes())),
+ f"-avasessionkey={bytes_to_wif(delegated_privkey.get_bytes())}",
],
- expected_msg="Error: " + message,
+ expected_msg=f"Error: {message}",
)
check_delegation_init_error(
@@ -622,10 +619,9 @@
node.assert_start_raises_init_error(
self.extra_args[0] + [
- "-avadelegation={}".format(delegation),
- "-avaproof={}".format(proof),
- "-avamasterkey={}".format(
- bytes_to_wif(random_privkey.get_bytes())),
+ f"-avadelegation={delegation}",
+ f"-avaproof={proof}",
+ f"-avamasterkey={bytes_to_wif(random_privkey.get_bytes())}",
],
expected_msg="Error: The master key does not match the delegation public key.",
)
@@ -633,22 +629,19 @@
# The node stacks another delegation level at startup
node.assert_start_raises_init_error(
self.extra_args[0] + [
- "-avadelegation={}".format(delegation),
- "-avaproof={}".format(proof),
- "-avamasterkey={}".format(
- bytes_to_wif(delegated_privkey.get_bytes())),
+ f"-avadelegation={delegation}",
+ f"-avaproof={proof}",
+ f"-avamasterkey={bytes_to_wif(delegated_privkey.get_bytes())}",
],
expected_msg="Error: The avalanche delegation has too many delegation levels.",
)
node.assert_start_raises_init_error(
self.extra_args[0] + [
- "-avadelegation={}".format(too_many_levels_delegation),
- "-avaproof={}".format(proof),
- "-avamasterkey={}".format(
- bytes_to_wif(too_many_levels_privkey.get_bytes())),
- "-avasessionkey={}".format(
- bytes_to_wif(too_many_levels_privkey.get_bytes())),
+ f"-avadelegation={too_many_levels_delegation}",
+ f"-avaproof={proof}",
+ f"-avamasterkey={bytes_to_wif(too_many_levels_privkey.get_bytes())}",
+ f"-avasessionkey={bytes_to_wif(too_many_levels_privkey.get_bytes())}",
],
expected_msg="Error: The avalanche delegation has too many delegation levels.",
)
diff --git a/test/functional/abc_rpc_getavalancheinfo.py b/test/functional/abc_rpc_getavalancheinfo.py
--- a/test/functional/abc_rpc_getavalancheinfo.py
+++ b/test/functional/abc_rpc_getavalancheinfo.py
@@ -75,8 +75,8 @@
self.log.info("The test node has a proof")
self.restart_node(0, self.extra_args[0] + [
- '-avaproof={}'.format(proof.serialize().hex()),
- '-avamasterkey={}'.format(bytes_to_wif(privkey.get_bytes())),
+ f'-avaproof={proof.serialize().hex()}',
+ f'-avamasterkey={bytes_to_wif(privkey.get_bytes())}',
'-avaproofstakeutxoconfirmations=1',
])
@@ -179,8 +179,8 @@
})
self.restart_node(0, self.extra_args[0] + [
- '-avaproof={}'.format(proof.serialize().hex()),
- '-avamasterkey={}'.format(bytes_to_wif(privkey.get_bytes())),
+ f'-avaproof={proof.serialize().hex()}',
+ f'-avamasterkey={bytes_to_wif(privkey.get_bytes())}',
'-avaproofstakeutxoconfirmations=3',
])
diff --git a/test/functional/abc_rpc_getavalancheproofs.py b/test/functional/abc_rpc_getavalancheproofs.py
--- a/test/functional/abc_rpc_getavalancheproofs.py
+++ b/test/functional/abc_rpc_getavalancheproofs.py
@@ -60,8 +60,8 @@
self.log.info("The test node has a proof")
self.restart_node(0, self.extra_args[0] + [
- '-avaproof={}'.format(proof.serialize().hex()),
- '-avamasterkey={}'.format(bytes_to_wif(privkey.get_bytes()))
+ f'-avaproof={proof.serialize().hex()}',
+ f'-avamasterkey={bytes_to_wif(privkey.get_bytes())}'
])
# Before local proof is validated
diff --git a/test/functional/abc_wallet_standardness.py b/test/functional/abc_wallet_standardness.py
--- a/test/functional/abc_wallet_standardness.py
+++ b/test/functional/abc_wallet_standardness.py
@@ -52,7 +52,7 @@
Finally, it attempts to spend the coin.
"""
- self.log.info("Trying script {}".format(scriptPubKey.hex(),))
+ self.log.info(f"Trying script {scriptPubKey.hex()}")
# get nonstandard node to fund the script
tx = CTransaction()

File Metadata

Mime Type
text/plain
Expires
Sat, Apr 26, 11:40 (16 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5573427
Default Alt Text
D13193.diff (17 KB)

Event Timeline