mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-03 01:33:20 +02:00
Merge bitcoin/bitcoin#32096: Move some tests and documentation from testnet3 to testnet4
aa7a898c23doc: use testnet4 in developer docs (Sjors Provoost)6c217d22fdtest: use testnet4 in argsman test (Sjors Provoost)7c200ece80test: use testnet4 in key_io_valid.json (Sjors Provoost)d424bd5941test: drop unused testnet3 magic bytes (Sjors Provoost)8cfc09fafetest: cover testnet4 magic in assumeutxo.py (Sjors Provoost)4281e3603azmq: use testnet4 in zmq_sub.py example (Sjors Provoost) Pull request description: In preparation for dropping testnet3 entirely in #31974 this PR migrates a few things to testnet4: * the ZMQ examples * developer docs * various unit tests * the snapshot magic byte check in `feature_assumeutxo.py` It drops `testnet3` from `MAGIC_BYTES` in the test framework, since no test uses it. ACKs for top commit: fjahr: re-ACKaa7a898c23maflcko: lgtm ACKaa7a898c23🔊 hodlinator: re-ACKaa7a898c23Tree-SHA512: 235f74273234e8fb2aedf0017dea5c16bb9813ec7a1f89a51abe85691f09830a5ead834115d7db0936e12e55a40bc81888856a8002fe507c1474407e77f8b9fb
This commit is contained in:
@@ -23,10 +23,11 @@ from test_framework.compressor import (
|
||||
from test_framework.messages import (
|
||||
CBlockHeader,
|
||||
from_hex,
|
||||
msg_headers,
|
||||
tx_from_hex,
|
||||
ser_varint,
|
||||
MAGIC_BYTES,
|
||||
MAX_MONEY,
|
||||
msg_headers,
|
||||
ser_varint,
|
||||
tx_from_hex,
|
||||
)
|
||||
from test_framework.p2p import (
|
||||
P2PInterface,
|
||||
@@ -102,15 +103,15 @@ class AssumeutxoTest(BitcoinTestFramework):
|
||||
self.log.info(" - snapshot file with mismatching network magic")
|
||||
invalid_magics = [
|
||||
# magic, name, real
|
||||
[0xf9beb4d9, "main", True],
|
||||
[0x0b110907, "test", True],
|
||||
[0x0a03cf40, "signet", True],
|
||||
[0x00000000, "", False],
|
||||
[0xffffffff, "", False],
|
||||
[MAGIC_BYTES["mainnet"], "main", True],
|
||||
[MAGIC_BYTES["testnet4"], "testnet4", True],
|
||||
[MAGIC_BYTES["signet"], "signet", True],
|
||||
[0x00000000.to_bytes(4, 'big'), "", False],
|
||||
[0xffffffff.to_bytes(4, 'big'), "", False],
|
||||
]
|
||||
for [magic, name, real] in invalid_magics:
|
||||
with open(bad_snapshot_path, 'wb') as f:
|
||||
f.write(valid_snapshot_contents[:7] + magic.to_bytes(4, 'big') + valid_snapshot_contents[11:])
|
||||
f.write(valid_snapshot_contents[:7] + magic + valid_snapshot_contents[11:])
|
||||
if real:
|
||||
assert_raises_rpc_error(parsing_error_code, f"Unable to parse metadata: The network of the snapshot ({name}) does not match the network of this node (regtest).", node.loadtxoutset, bad_snapshot_path)
|
||||
else:
|
||||
|
||||
@@ -78,10 +78,10 @@ MAX_OP_RETURN_RELAY = 83
|
||||
DEFAULT_MEMPOOL_EXPIRY_HOURS = 336 # hours
|
||||
|
||||
MAGIC_BYTES = {
|
||||
"mainnet": b"\xf9\xbe\xb4\xd9", # mainnet
|
||||
"testnet3": b"\x0b\x11\x09\x07", # testnet3
|
||||
"regtest": b"\xfa\xbf\xb5\xda", # regtest
|
||||
"signet": b"\x0a\x03\xcf\x40", # signet
|
||||
"mainnet": b"\xf9\xbe\xb4\xd9",
|
||||
"testnet4": b"\x1c\x16\x3f\x28",
|
||||
"regtest": b"\xfa\xbf\xb5\xda",
|
||||
"signet": b"\x0a\x03\xcf\x40",
|
||||
}
|
||||
|
||||
def sha256(s):
|
||||
|
||||
Reference in New Issue
Block a user