-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #93 from KomodoPlatform/dev
sync master
- Loading branch information
Showing
5 changed files
with
81 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env python3 | ||
from os.path import dirname, abspath | ||
import re | ||
import requests | ||
|
||
PROJECT_PATH = dirname(dirname(abspath(__file__))) | ||
|
||
with open(f"{PROJECT_PATH}/lib/app_config/app_config.dart", "r") as f: | ||
dart_file = f.read() | ||
urls = re.findall( | ||
r"http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|/|[!*\\(\\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+", | ||
dart_file, | ||
) | ||
for url in urls: | ||
try: | ||
if ( | ||
"discord" in url | ||
or "github.com" in url | ||
or url.endswith("?") | ||
or "/api/" in url | ||
): | ||
continue | ||
cleaned_url = url.rstrip(".,;'\"") | ||
response = requests.head(cleaned_url, allow_redirects=True) | ||
if response.status_code >= 400 and response.status_code != 405: | ||
raise AssertionError( | ||
f"{cleaned_url} is unreachable (HTTP {response.status_code})" | ||
) | ||
except requests.ConnectionError: | ||
raise AssertionError(f"{cleaned_url} is unreachable (Connection Error)") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env python3 | ||
from os.path import dirname, abspath | ||
import re | ||
import json | ||
|
||
PROJECT_PATH = dirname(dirname(abspath(__file__))) | ||
|
||
with open(f"{PROJECT_PATH}/assets/coins_config.json", "r") as f: | ||
coins_json = json.load(f) | ||
wallet_only_coins = [ | ||
coin["coin"] for coin in coins_json.values() if coin["wallet_only"] | ||
] | ||
with open(f"{PROJECT_PATH}/lib/app_config/app_config.dart", "r") as f: | ||
dart_file = f.read() | ||
coins_dart = re.findall(r"walletOnlyCoins => \[\s*([^]]+?)\s*\]", dart_file) | ||
coins_dart = [coin.strip().strip("'") for coin in coins_dart[0].split(",") if coin] | ||
missing_coins = set(wallet_only_coins) - set(coins_dart) | ||
assert len(missing_coins) == 0, f"Missing coins: {missing_coins}" |