Skip to content

Commit

Permalink
add lookup at barn orderbook
Browse files Browse the repository at this point in the history
  • Loading branch information
harisang committed May 19, 2023
1 parent 433a6c5 commit 6457043
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/monitoring_tests/template_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,25 @@ def get_endpoint_order_data(cls, tx_hash: str) -> List[Any]:
prod_endpoint_url = (
"https://api.cow.fi/mainnet/api/v1/transactions/" + tx_hash + "/orders"
)
barn_endpoint_url = (
"https://barn.api.cow.fi/mainnet/api/v1/transactions/" + tx_hash + "/orders"
)
orders_response = requests.get(
prod_endpoint_url,
headers=header,
timeout=30,
)
if orders_response.status_code != SUCCESS_CODE:
cls.logger.error(
"Error loading orders from mainnet: %s", orders_response.status_code
orders_response = requests.get(
barn_endpoint_url,
headers=header,
timeout=30,
)
if orders_response.status_code != SUCCESS_CODE:
cls.logger.error(
"Error loading orders from mainnet: %s", orders_response.status_code
)
return []

orders = json.loads(orders_response.text)

Expand Down

0 comments on commit 6457043

Please sign in to comment.