@@ -504,9 +504,9 @@ def verify_custom(synapse: MyCustomSynapse):
504
504
)
505
505
506
506
param_class = first_param .annotation
507
- assert issubclass (
508
- param_class , Synapse
509
- ), "The first argument of forward_fn must inherit from bittensor.Synapse"
507
+ assert issubclass (param_class , Synapse ), (
508
+ "The first argument of forward_fn must inherit from bittensor. Synapse"
509
+ )
510
510
request_name = param_class .__name__
511
511
512
512
async def endpoint (* args , ** kwargs ):
@@ -580,19 +580,19 @@ async def endpoint(*args, **kwargs):
580
580
blacklist_sig = Signature (
581
581
expected_params , return_annotation = Tuple [bool , str ]
582
582
)
583
- assert (
584
- signature ( blacklist_fn ) == blacklist_sig
585
- ), f"The blacklist_fn function must have the signature: blacklist( synapse: { request_name } ) -> tuple[bool, str]"
583
+ assert signature ( blacklist_fn ) == blacklist_sig , (
584
+ f"The blacklist_fn function must have the signature: blacklist( synapse: { request_name } ) -> tuple[bool, str]"
585
+ )
586
586
if priority_fn :
587
587
priority_sig = Signature (expected_params , return_annotation = float )
588
- assert (
589
- signature ( priority_fn ) == priority_sig
590
- ), f"The priority_fn function must have the signature: priority( synapse: { request_name } ) -> float"
588
+ assert signature ( priority_fn ) == priority_sig , (
589
+ f"The priority_fn function must have the signature: priority( synapse: { request_name } ) -> float"
590
+ )
591
591
if verify_fn :
592
592
verify_sig = Signature (expected_params , return_annotation = None )
593
- assert (
594
- signature ( verify_fn ) == verify_sig
595
- ), f"The verify_fn function must have the signature: verify( synapse: { request_name } ) -> None"
593
+ assert signature ( verify_fn ) == verify_sig , (
594
+ f"The verify_fn function must have the signature: verify( synapse: { request_name } ) -> None"
595
+ )
596
596
597
597
# Store functions in appropriate attribute dictionaries
598
598
self .forward_class_types [request_name ] = param_class
@@ -747,9 +747,9 @@ def check_config(cls, config: "Config"):
747
747
Raises:
748
748
AssertionError: If the axon or external ports are not in range [1024, 65535]
749
749
"""
750
- assert (
751
- 1024 < config . axon . port < 65535
752
- ), "Axon port must be in range [1024, 65535]"
750
+ assert 1024 < config . axon . port < 65535 , (
751
+ "Axon port must be in range [1024, 65535]"
752
+ )
753
753
754
754
assert config .axon .external_port is None or (
755
755
1024 < config .axon .external_port < 65535
0 commit comments