@@ -66,7 +66,8 @@ def validate_decimal_places(value: Decimal, decimal_places: int, name: str) -> N
6666 ValueError: If the value has more decimal places than allowed.
6767 or the value is not a valid decimal number.
6868 """
69- assert decimal_places >= 0 , "The decimal places must be a non-negative integer."
69+ if decimal_places < 0 :
70+ raise ValueError ("The decimal places must be a non-negative integer." )
7071
7172 try :
7273 exponent = int (value .as_tuple ().exponent )
@@ -287,7 +288,7 @@ async def stream_public_trades(
287288 return self ._public_trades_streams [public_trade_filter ].new_receiver ()
288289
289290 def validate_params (
290- # pylint: disable=too-many-arguments, too-many-positional-arguments
291+ # pylint: disable=too-many-arguments, too-many-positional-arguments, too-many-branches
291292 self ,
292293 price : Price | None | _Sentinel = NO_VALUE ,
293294 quantity : Energy | None | _Sentinel = NO_VALUE ,
@@ -359,9 +360,8 @@ def validate_params(
359360 if valid_until < datetime .now (timezone .utc ):
360361 raise ValueError ("valid_until must be in the future" )
361362 if order_type is not None :
362- assert order_type == OrderType .LIMIT , NotImplementedError (
363- "Currently only limit orders are supported"
364- )
363+ if order_type != OrderType .LIMIT :
364+ raise NotImplementedError ("Currently only limit orders are supported." )
365365
366366 async def create_gridpool_order (
367367 # pylint: disable=too-many-arguments, too-many-positional-arguments, too-many-locals
0 commit comments