Reflect PR feedback
- Remove leftover `int` in `GossipsubParams` - Remove default fields in tests
This commit is contained in:
parent
33d233f5df
commit
716c60ca6d
|
@ -41,7 +41,7 @@ class GossipsubFactory(factory.Factory):
|
||||||
degree_high = GOSSIPSUB_PARAMS.degree_high
|
degree_high = GOSSIPSUB_PARAMS.degree_high
|
||||||
time_to_live = GOSSIPSUB_PARAMS.time_to_live
|
time_to_live = GOSSIPSUB_PARAMS.time_to_live
|
||||||
gossip_window = GOSSIPSUB_PARAMS.gossip_window
|
gossip_window = GOSSIPSUB_PARAMS.gossip_window
|
||||||
gossip_history = int(GOSSIPSUB_PARAMS.gossip_history)
|
gossip_history = GOSSIPSUB_PARAMS.gossip_history
|
||||||
heartbeat_interval = GOSSIPSUB_PARAMS.heartbeat_interval
|
heartbeat_interval = GOSSIPSUB_PARAMS.heartbeat_interval
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,20 +11,7 @@ from .utils import dense_connect, one_to_all_connect
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"num_hosts, gossipsub_params",
|
"num_hosts, gossipsub_params",
|
||||||
(
|
((4, GossipsubParams(degree=4, degree_low=3, degree_high=5)),),
|
||||||
(
|
|
||||||
4,
|
|
||||||
GossipsubParams(
|
|
||||||
degree=4,
|
|
||||||
degree_low=3,
|
|
||||||
degree_high=5,
|
|
||||||
time_to_live=30,
|
|
||||||
gossip_window=3,
|
|
||||||
gossip_history=5,
|
|
||||||
heartbeat_interval=0.5,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_join(num_hosts, hosts, gossipsubs, pubsubs_gsub):
|
async def test_join(num_hosts, hosts, gossipsubs, pubsubs_gsub):
|
||||||
|
@ -149,21 +136,7 @@ async def test_handle_graft(pubsubs_gsub, hosts, gossipsubs, event_loop, monkeyp
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"num_hosts, gossipsub_params",
|
"num_hosts, gossipsub_params", ((2, GossipsubParams(heartbeat_interval=3)),)
|
||||||
(
|
|
||||||
(
|
|
||||||
2,
|
|
||||||
GossipsubParams(
|
|
||||||
degree=10,
|
|
||||||
degree_low=9,
|
|
||||||
degree_high=11,
|
|
||||||
time_to_live=30,
|
|
||||||
gossip_window=3,
|
|
||||||
gossip_history=5,
|
|
||||||
heartbeat_interval=3,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_handle_prune(pubsubs_gsub, hosts, gossipsubs):
|
async def test_handle_prune(pubsubs_gsub, hosts, gossipsubs):
|
||||||
|
@ -375,10 +348,8 @@ async def test_fanout_maintenance(hosts, pubsubs_gsub):
|
||||||
degree=1,
|
degree=1,
|
||||||
degree_low=0,
|
degree_low=0,
|
||||||
degree_high=2,
|
degree_high=2,
|
||||||
time_to_live=30,
|
|
||||||
gossip_window=50,
|
gossip_window=50,
|
||||||
gossip_history=100,
|
gossip_history=100,
|
||||||
heartbeat_interval=0.5,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user