Skip to content

Commit

Permalink
Updated to reflect bitcoin version
Browse files Browse the repository at this point in the history
  • Loading branch information
janus committed Dec 28, 2023
1 parent 0c2c1fe commit aed60ed
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
7 changes: 4 additions & 3 deletions test/functional/feature_anchors.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,15 @@ def run_test(self):
self.log.info("Check the addresses in anchors.dat")

with open(node_anchors_path, "rb") as file_handler:
anchors = file_handler.read().hex()
anchors = file_handler.read()

anchors_hex = anchors.hex()
for port in block_relay_nodes_port:
ip_port = ip + port
assert ip_port in anchors
assert ip_port in anchors_hex
for port in inbound_nodes_port:
ip_port = ip + port
assert ip_port not in anchors
assert ip_port not in anchors_hex

self.log.info("Perturb anchors.dat to test it doesn't throw an error during initialization")
with self.nodes[0].assert_debug_log(["0 block-relay-only anchors will be tried for connections."]):
Expand Down
4 changes: 0 additions & 4 deletions test/functional/test_framework/blocktools.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@
keys_to_multisig_script,
script_to_p2wsh_script,
)
from .script_util import (
key_to_p2wpkh_script,
script_to_p2wsh_script,
)
from .util import assert_equal

WITNESS_SCALE_FACTOR = 4
Expand Down
12 changes: 11 additions & 1 deletion test/functional/test_framework/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,19 @@

WITNESS_SCALE_FACTOR = 4

DEFAULT_ANCESTOR_LIMIT = 25 # default max number of in-mempool ancestors
DEFAULT_DESCENDANT_LIMIT = 25 # default max number of in-mempool descendants

# Default setting for -datacarriersize. 80 bytes of data, +1 for OP_RETURN, +2 for the pushdata opcodes.
MAX_OP_RETURN_RELAY = 83

DEFAULT_MEMPOOL_EXPIRY_HOURS = 336 # hours

# Serialization/deserialization tools
def keccak256(s):
h = sha3.keccak_256()
from sha3 import keccak_256
#print(dir(sha3))
h = keccak_256()
h.update(s)
return h.digest()

Expand Down

0 comments on commit aed60ed

Please sign in to comment.