Merge bitcoin/bitcoin#30029: test: remove duplicate WITNESS_SCALE_FACTOR constant definition

af3c18169a [test]: remove duplicate WITNESS_SCALE_FACTOR (ismaelsadeeq)

Pull request description:

  Notice this while working on #29523

  - `blocktools.py` and `messages.py` both define `WITNESS_SCALE_FACTOR` constant

  99d7538cdb/test/functional/test_framework/blocktools.py (L48)

  99d7538cdb/test/functional/test_framework/messages.py (L68)
  - This PR deletes the one in `blocktools.py` and update the tests to only use `WITNESS_SCALE_FACTOR` from `messages.py`

ACKs for top commit:
  maflcko:
    ACK af3c18169a
  sipa:
    ACK af3c18169a
  achow101:
    ACK af3c18169a
  glozow:
    lgtm ACK af3c18169a
  brunoerg:
    ACK af3c18169a
  willcl-ark:
    ACK af3c18169a

Tree-SHA512: 6bd8060c9eea10e03940acee2aa4cd08e4e0afb6d26be3e6300ad405fd0af5b373a00e994eb39515a2dcafa1625562bcd57945049a84b9c9dcc7ea60c24f0911
This commit is contained in:
Ava Chow 2024-05-03 12:36:00 -04:00
commit f9486de6a9
No known key found for this signature in database
GPG key ID: 17565732E08E5E41
2 changed files with 2 additions and 2 deletions

View file

@ -10,7 +10,6 @@ from test_framework.blocktools import (
create_block,
add_witness_commitment,
MAX_BLOCK_SIGOPS_WEIGHT,
WITNESS_SCALE_FACTOR,
)
from test_framework.messages import (
COutPoint,
@ -20,6 +19,7 @@ from test_framework.messages import (
CTxOut,
SEQUENCE_FINAL,
tx_from_hex,
WITNESS_SCALE_FACTOR,
)
from test_framework.script import (
ANNEX_TAG,

View file

@ -28,6 +28,7 @@ from .messages import (
ser_uint256,
tx_from_hex,
uint256_from_str,
WITNESS_SCALE_FACTOR,
)
from .script import (
CScript,
@ -45,7 +46,6 @@ from .script_util import (
)
from .util import assert_equal
WITNESS_SCALE_FACTOR = 4
MAX_BLOCK_SIGOPS = 20000
MAX_BLOCK_SIGOPS_WEIGHT = MAX_BLOCK_SIGOPS * WITNESS_SCALE_FACTOR