Skip to content

Commit

Permalink
Vary the test tx count for gas price strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanjw committed Aug 1, 2018
1 parent c138ded commit a2dac87
Showing 1 changed file with 26 additions and 17 deletions.
43 changes: 26 additions & 17 deletions tests/core/gas-strategies/test_time_based_gas_price_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ def _get_block_by_something(method, params):
'transactions': [
{'gasPrice': 70},
{'gasPrice': 60},
{'gasPrice': 60},
{'gasPrice': 60},
{'gasPrice': 15},
{'gasPrice': 5},
{'gasPrice': 50},
],
'miner': '0xA',
'timestamp': 100,
Expand All @@ -51,8 +56,6 @@ def _get_block_by_something(method, params):
'number': 3,
'parentHash': '0x0000000000000000000000000000000000000000000000000000000000000002',
'transactions': [
{'gasPrice': 10},
{'gasPrice': 50},
{'gasPrice': 100},
],
'miner': '0xC',
Expand All @@ -64,9 +67,6 @@ def _get_block_by_something(method, params):
'number': 2,
'parentHash': '0x0000000000000000000000000000000000000000000000000000000000000001',
'transactions': [
{'gasPrice': 50},
{'gasPrice': 70},
{'gasPrice': 100},
],
'miner': '0xB',
'timestamp': 40,
Expand Down Expand Up @@ -96,6 +96,15 @@ def _get_block_by_something(method, params):
{'gasPrice': 30},
{'gasPrice': 50},
{'gasPrice': 60},
{'gasPrice': 30},
{'gasPrice': 50},
{'gasPrice': 60},
{'gasPrice': 30},
{'gasPrice': 50},
{'gasPrice': 60},
{'gasPrice': 30},
{'gasPrice': 54},
{'gasPrice': 10000000000000000000000},
],
'miner': '0xA',
'timestamp': 0,
Expand All @@ -108,21 +117,21 @@ def _get_block_by_something(method, params):
'strategy_params,expected',
(
# 120 second wait times
(dict(max_wait_seconds=80, sample_size=5, probability=98), 61),
(dict(max_wait_seconds=80, sample_size=5, probability=90), 46),
(dict(max_wait_seconds=80, sample_size=5, probability=50), 40),
(dict(max_wait_seconds=80, sample_size=5, probability=98), 70),
(dict(max_wait_seconds=80, sample_size=5, probability=90), 23),
(dict(max_wait_seconds=80, sample_size=5, probability=50), 7),
# 60 second wait times
(dict(max_wait_seconds=60, sample_size=5, probability=98), 62),
(dict(max_wait_seconds=60, sample_size=5, probability=90), 55),
(dict(max_wait_seconds=60, sample_size=5, probability=50), 40),
(dict(max_wait_seconds=60, sample_size=5, probability=98), 92),
(dict(max_wait_seconds=60, sample_size=5, probability=90), 48),
(dict(max_wait_seconds=60, sample_size=5, probability=50), 7),
# 40 second wait times
(dict(max_wait_seconds=40, sample_size=5, probability=98), 63),
(dict(max_wait_seconds=40, sample_size=5, probability=90), 61),
(dict(max_wait_seconds=40, sample_size=5, probability=50), 40),
(dict(max_wait_seconds=40, sample_size=5, probability=98), 100),
(dict(max_wait_seconds=40, sample_size=5, probability=90), 81),
(dict(max_wait_seconds=40, sample_size=5, probability=50), 7),
# 20 second wait times
(dict(max_wait_seconds=20, sample_size=5, probability=98), 63),
(dict(max_wait_seconds=20, sample_size=5, probability=90), 62),
(dict(max_wait_seconds=20, sample_size=5, probability=50), 50),
(dict(max_wait_seconds=20, sample_size=5, probability=98), 100),
(dict(max_wait_seconds=20, sample_size=5, probability=90), 100),
(dict(max_wait_seconds=20, sample_size=5, probability=50), 34),
),
)
def test_time_based_gas_price_strategy(strategy_params, expected):
Expand Down

0 comments on commit a2dac87

Please sign in to comment.