added dedicated test file and moved timed_cache to tools

This commit is contained in:
Mystical
2025-03-15 13:19:59 +05:30
committed by Paul Robinson
parent bf699351e1
commit c86f3d0467
12 changed files with 201 additions and 67 deletions

View File

@ -424,7 +424,6 @@ class GossipsubFactory(factory.Factory):
degree = GOSSIPSUB_PARAMS.degree
degree_low = GOSSIPSUB_PARAMS.degree_low
degree_high = GOSSIPSUB_PARAMS.degree_high
time_to_live = GOSSIPSUB_PARAMS.time_to_live
gossip_window = GOSSIPSUB_PARAMS.gossip_window
gossip_history = GOSSIPSUB_PARAMS.gossip_history
heartbeat_initial_delay = GOSSIPSUB_PARAMS.heartbeat_initial_delay
@ -448,6 +447,7 @@ class PubsubFactory(factory.Factory):
router: IPubsubRouter,
cache_size: int,
seen_ttl: int,
sweep_interval: int,
strict_signing: bool,
msg_id_constructor: Callable[[rpc_pb2.Message], bytes] = None,
) -> AsyncIterator[Pubsub]:
@ -456,6 +456,7 @@ class PubsubFactory(factory.Factory):
router=router,
cache_size=cache_size,
seen_ttl=seen_ttl,
sweep_interval=sweep_interval,
strict_signing=strict_signing,
msg_id_constructor=msg_id_constructor,
)
@ -470,7 +471,8 @@ class PubsubFactory(factory.Factory):
number: int,
routers: Sequence[IPubsubRouter],
cache_size: int = None,
seen_ttl: int = None,
seen_ttl: int = 120,
sweep_interval: int = 60,
strict_signing: bool = False,
security_protocol: TProtocol = None,
muxer_opt: TMuxerOptions = None,
@ -488,6 +490,7 @@ class PubsubFactory(factory.Factory):
router,
cache_size,
seen_ttl,
sweep_interval,
strict_signing,
msg_id_constructor,
)
@ -503,6 +506,7 @@ class PubsubFactory(factory.Factory):
number: int,
cache_size: int = None,
seen_ttl: int = 120,
sweep_interval: int = 60,
strict_signing: bool = False,
protocols: Sequence[TProtocol] = None,
security_protocol: TProtocol = None,
@ -520,6 +524,7 @@ class PubsubFactory(factory.Factory):
floodsubs,
cache_size,
seen_ttl,
sweep_interval,
strict_signing,
security_protocol=security_protocol,
muxer_opt=muxer_opt,
@ -567,7 +572,6 @@ class PubsubFactory(factory.Factory):
degree=degree,
degree_low=degree_low,
degree_high=degree_high,
time_to_live=time_to_live,
gossip_window=gossip_window,
heartbeat_interval=heartbeat_interval,
)