Reflect PR feedback

- Remove leftover `int` in `GossipsubParams`
- Remove default fields in tests
This commit is contained in:
mhchia 2019-08-01 21:38:14 +08:00
parent 33d233f5df
commit 716c60ca6d
No known key found for this signature in database
GPG Key ID: 389EFBEA1362589A
2 changed files with 3 additions and 32 deletions

View File

@ -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

View File

@ -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,
), ),
), ),
), ),