Skip to content

Commit 28e3ee0

Browse files
committed
test: create assert_less_than util and add to where imports are needed
In the functional tests there are lots of cases where we assert < which this new util will replace, we also are adding the imports and the following commit will add the new assertion
1 parent 1ffbd96 commit 28e3ee0

13 files changed

+23
-3
lines changed

test/functional/feature_coinstatsindex.py

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from test_framework.test_framework import BitcoinTestFramework
2929
from test_framework.util import (
3030
assert_equal,
31+
assert_greater_than,
3132
assert_raises_rpc_error,
3233
)
3334
from test_framework.wallet import (

test/functional/feature_rbf.py

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from test_framework.test_framework import BitcoinTestFramework
1515
from test_framework.util import (
1616
assert_equal,
17+
assert_greater_than,
1718
assert_raises_rpc_error,
1819
)
1920
from test_framework.wallet import MiniWallet

test/functional/mempool_resurrect.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
"""Test resurrection of mined transactions when the blockchain is re-organized."""
66

77
from test_framework.test_framework import BitcoinTestFramework
8-
from test_framework.util import assert_equal
8+
from test_framework.util import (
9+
assert_equal,
10+
assert_greater_than,
11+
)
912
from test_framework.wallet import MiniWallet
1013

1114

test/functional/p2p_segwit.py

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
from test_framework.test_framework import BitcoinTestFramework
8585
from test_framework.util import (
8686
assert_equal,
87+
assert_greater_than,
8788
softfork_active,
8889
assert_raises_rpc_error,
8990
)

test/functional/p2p_sendtxrcncl.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
P2P_VERSION,
2020
)
2121
from test_framework.test_framework import BitcoinTestFramework
22-
from test_framework.util import assert_equal
22+
from test_framework.util import (
23+
assert_equal,
24+
assert_greater_than,
25+
)
2326

2427
class PeerNoVerack(P2PInterface):
2528
def __init__(self, wtxidrelay=True):

test/functional/rpc_createmultisig.py

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from test_framework.util import (
1818
assert_raises_rpc_error,
1919
assert_equal,
20+
assert_greater_than,
2021
)
2122
from test_framework.wallet_util import generate_keypair
2223
from test_framework.wallet import (

test/functional/test_framework/blocktools.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@
4343
keys_to_multisig_script,
4444
script_to_p2wsh_script,
4545
)
46-
from .util import assert_equal
46+
from .util import (
47+
assert_equal,
48+
assert_greater_than,
49+
)
4750

4851
WITNESS_SCALE_FACTOR = 4
4952
MAX_BLOCK_SIGOPS = 20000

test/functional/test_framework/netutil.py

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
import array
1414
import os
1515

16+
from .util import assert_greater_than
17+
1618
# STATE_ESTABLISHED = '01'
1719
# STATE_SYN_SENT = '02'
1820
# STATE_SYN_RECV = '03'

test/functional/test_framework/p2p.py

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
MAX_NODES,
8181
p2p_port,
8282
wait_until_helper_internal,
83+
assert_greater_than,
8384
)
8485
from test_framework.v2_p2p import (
8586
EncryptedP2PState,

test/functional/test_framework/script.py

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
from .key import TaggedHash, tweak_add_pubkey, compute_xonly_pubkey
1515

16+
1617
from .messages import (
1718
CTransaction,
1819
CTxOut,

test/functional/wallet_abandonconflict.py

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from test_framework.test_framework import BitcoinTestFramework
1717
from test_framework.util import (
1818
assert_equal,
19+
assert_greater_than,
1920
assert_raises_rpc_error,
2021
)
2122

test/functional/wallet_conflicts.py

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from test_framework.test_framework import BitcoinTestFramework
1414
from test_framework.util import (
1515
assert_equal,
16+
assert_greater_than,
1617
)
1718

1819
class TxConflicts(BitcoinTestFramework):

test/functional/wallet_create_tx.py

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from test_framework.test_framework import BitcoinTestFramework
77
from test_framework.util import (
88
assert_equal,
9+
assert_greater_than,
910
assert_raises_rpc_error,
1011
)
1112
from test_framework.blocktools import (

0 commit comments

Comments
 (0)