From fc3ac59daf93256d952595e58bb6f87f4751289a Mon Sep 17 00:00:00 2001 From: mmsqe Date: Wed, 9 Nov 2022 09:02:05 +0800 Subject: [PATCH 1/3] fix unstable tx_priority test --- tests/integration_tests/test_priority.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/integration_tests/test_priority.py b/tests/integration_tests/test_priority.py index d6502a298e..775c8ded80 100644 --- a/tests/integration_tests/test_priority.py +++ b/tests/integration_tests/test_priority.py @@ -184,7 +184,10 @@ def test_native_tx_priority(ethermint: Ethermint): tx_indexes = [(int(r["height"]), r["index"]) for r in tx_results] print(tx_indexes) # the first sent tx are included later, because of lower priority - assert all(i1 > i2 for i1, i2 in zip(tx_indexes, tx_indexes[1:])) + # ensure desc within continuous block + assert all(( + i1[0] < i2[0] or i1[0] == i2[0] and i1[1] > i2[1] + ) for i1, i2 in zip(tx_indexes, tx_indexes[1:])) def get_max_priority_price(max_priority_price): From 21f878f503ecd18905efe372fd72771b569ae7f3 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Wed, 9 Nov 2022 09:56:38 +0800 Subject: [PATCH 2/3] Update tests/integration_tests/test_priority.py Co-authored-by: yihuang --- tests/integration_tests/test_priority.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration_tests/test_priority.py b/tests/integration_tests/test_priority.py index 775c8ded80..b3020e29c5 100644 --- a/tests/integration_tests/test_priority.py +++ b/tests/integration_tests/test_priority.py @@ -186,7 +186,7 @@ def test_native_tx_priority(ethermint: Ethermint): # the first sent tx are included later, because of lower priority # ensure desc within continuous block assert all(( - i1[0] < i2[0] or i1[0] == i2[0] and i1[1] > i2[1] + i1[0] < i2[0] or (i1[0] == i2[0] and i1[1] > i2[1]) ) for i1, i2 in zip(tx_indexes, tx_indexes[1:])) From 1bbbdc1ccfb4ee2114ad111b501a8ba1491974a4 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Wed, 9 Nov 2022 10:01:20 +0800 Subject: [PATCH 3/3] Update tests/integration_tests/test_priority.py Co-authored-by: yihuang --- tests/integration_tests/test_priority.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration_tests/test_priority.py b/tests/integration_tests/test_priority.py index b3020e29c5..c3de9cec0f 100644 --- a/tests/integration_tests/test_priority.py +++ b/tests/integration_tests/test_priority.py @@ -186,8 +186,8 @@ def test_native_tx_priority(ethermint: Ethermint): # the first sent tx are included later, because of lower priority # ensure desc within continuous block assert all(( - i1[0] < i2[0] or (i1[0] == i2[0] and i1[1] > i2[1]) - ) for i1, i2 in zip(tx_indexes, tx_indexes[1:])) + b1 < b2 or (b1 == b2 and i1 > i2) + ) for (b1, i1), (b2, i2) in zip(tx_indexes, tx_indexes[1:])) def get_max_priority_price(max_priority_price):