mirror of https://github.com/nucypher/nucypher.git
Clean up validation of method value for TimeCondition. There is an implicit check by superclass that already uses _validate_method - utilize it.
parent
8e4d62861e
commit
d6b5fb9c37
|
@ -24,16 +24,16 @@ class TimeRPCCall(RPCCall):
|
|||
name: Optional[str] = None,
|
||||
parameters: Optional[List[Any]] = None,
|
||||
):
|
||||
if method != self.METHOD:
|
||||
raise ValueError(
|
||||
f"{self.__class__.__name__} must be instantiated with the {self.METHOD} method."
|
||||
)
|
||||
if parameters:
|
||||
raise ValueError(f"{self.METHOD} does not take any parameters")
|
||||
|
||||
super().__init__(chain=chain, method=method, name=name)
|
||||
|
||||
def _validate_method(self, method):
|
||||
if method != self.METHOD:
|
||||
raise ValueError(
|
||||
f"{self.__class__.__name__} must be instantiated with the {self.METHOD} method."
|
||||
)
|
||||
return method
|
||||
|
||||
def _execute(self, w3: Web3, resolved_parameters: List[Any]) -> Any:
|
||||
|
|
Loading…
Reference in New Issue