Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Commit

Permalink
Bug fix: unescape backslashes in regexes
Browse files Browse the repository at this point in the history
Root problem is that there are too many backslashes in the SRA spec
itself.  See #1727

This was previously fixed for heavily-tested endpoints (get and post
order, etc), but was only recently discovered for the get-order-config
endpoint.
  • Loading branch information
feuGeneA committed Dec 17, 2019
1 parent 51ca310 commit 0cd0e0b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ def min_amount(self, min_amount):
:type: str
"""
if min_amount is not None and not re.search(
r"^\\d+$", min_amount
r"^\d+$", min_amount
): # noqa: E501
raise ValueError(
r"Invalid value for `min_amount`, must be a follow pattern or equal to `/^\\d+$/`"
r"Invalid value for `min_amount`, must be a follow pattern or equal to `/^\d+$/`"
) # noqa: E501

self._min_amount = min_amount
Expand All @@ -131,10 +131,10 @@ def max_amount(self, max_amount):
:type: str
"""
if max_amount is not None and not re.search(
r"^\\d+$", max_amount
r"^\d+$", max_amount
): # noqa: E501
raise ValueError(
r"Invalid value for `max_amount`, must be a follow pattern or equal to `/^\\d+$/`"
r"Invalid value for `max_amount`, must be a follow pattern or equal to `/^\d+$/`"
) # noqa: E501

self._max_amount = max_amount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ def maker_asset_amount(self, maker_asset_amount):
"Invalid value for `maker_asset_amount`, must not be `None`"
) # noqa: E501
if maker_asset_amount is not None and not re.search(
r"^\\d+$", maker_asset_amount
r"^\d+$", maker_asset_amount
): # noqa: E501
raise ValueError(
r"Invalid value for `maker_asset_amount`, must be a follow pattern or equal to `/^\\d+$/`"
r"Invalid value for `maker_asset_amount`, must be a follow pattern or equal to `/^\d+$/`"
) # noqa: E501

self._maker_asset_amount = maker_asset_amount
Expand Down Expand Up @@ -191,10 +191,10 @@ def taker_asset_amount(self, taker_asset_amount):
"Invalid value for `taker_asset_amount`, must not be `None`"
) # noqa: E501
if taker_asset_amount is not None and not re.search(
r"^\\d+$", taker_asset_amount
r"^\d+$", taker_asset_amount
): # noqa: E501
raise ValueError(
r"Invalid value for `taker_asset_amount`, must be a follow pattern or equal to `/^\\d+$/`"
r"Invalid value for `taker_asset_amount`, must be a follow pattern or equal to `/^\d+$/`"
) # noqa: E501

self._taker_asset_amount = taker_asset_amount
Expand Down Expand Up @@ -315,10 +315,10 @@ def expiration_time_seconds(self, expiration_time_seconds):
"Invalid value for `expiration_time_seconds`, must not be `None`"
) # noqa: E501
if expiration_time_seconds is not None and not re.search(
r"^\\d+$", expiration_time_seconds
r"^\d+$", expiration_time_seconds
): # noqa: E501
raise ValueError(
r"Invalid value for `expiration_time_seconds`, must be a follow pattern or equal to `/^\\d+$/`"
r"Invalid value for `expiration_time_seconds`, must be a follow pattern or equal to `/^\d+$/`"
) # noqa: E501

self._expiration_time_seconds = expiration_time_seconds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ def maker_fee(self, maker_fee):
"Invalid value for `maker_fee`, must not be `None`"
) # noqa: E501
if maker_fee is not None and not re.search(
r"^\\d+$", maker_fee
r"^\d+$", maker_fee
): # noqa: E501
raise ValueError(
r"Invalid value for `maker_fee`, must be a follow pattern or equal to `/^\\d+$/`"
r"Invalid value for `maker_fee`, must be a follow pattern or equal to `/^\d+$/`"
) # noqa: E501

self._maker_fee = maker_fee
Expand Down Expand Up @@ -109,10 +109,10 @@ def taker_fee(self, taker_fee):
"Invalid value for `taker_fee`, must not be `None`"
) # noqa: E501
if taker_fee is not None and not re.search(
r"^\\d+$", taker_fee
r"^\d+$", taker_fee
): # noqa: E501
raise ValueError(
r"Invalid value for `taker_fee`, must be a follow pattern or equal to `/^\\d+$/`"
r"Invalid value for `taker_fee`, must be a follow pattern or equal to `/^\d+$/`"
) # noqa: E501

self._taker_fee = taker_fee
Expand Down

0 comments on commit 0cd0e0b

Please sign in to comment.