Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev -> testnet #82

Merged
merged 2 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 26 additions & 8 deletions base/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,32 @@

WSGI_APPLICATION = "base.wsgi.application"

CORS_ALLOWED_ORIGINS = [
"http://localhost:3000",
"https://alpha.potlock.io",
"https://alpha.potlock.org",
"https://alpha.potlock.xyz",
"https://alpha.potlock.app", # regex matching might not be advisable.
"http://dev.local",
"https://dev.local",

if ENVIRONMENT == "testnet":
CORS_ALLOWED_ORIGINS = [
"http://localhost:3000",
"https://test.potlock.org",
"https://test.potlock.xyz",
"https://test.potlock.io",
"https://test.potlock.app",
"https://testnet.potlock.org",
"https://testnet.potlock.xyz",
"https://testnet.potlock.app",
"https://testnet.potlock.io"
]
else:
CORS_ALLOWED_ORIGINS = [
"http://localhost:3000",
"https://alpha.potlock.io",
"https://alpha.potlock.org",
"https://alpha.potlock.xyz",
"https://alpha.potlock.app", # regex matching might not be advisable.
"http://dev.local",
"https://dev.local",
]

CORS_ALLOWED_ORIGIN_REGEXES = [
"^https:\/\/potlock-next-[\w-]+-potlock\.vercel\.app\/?$"
]

# REDIS / CACHE CONFIGS
Expand Down
2 changes: 1 addition & 1 deletion indexer_app/management/commands/populatedata.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def handle(self, *args, **options):
if config.get("chef"):
chef, _ = Account.objects.get_or_create(defaults={"chain_id":1},id=config["chef"])
pot_defaults = {
"pot_factory_account": POTFACTORY_ID,
"pot_factory_id": POTFACTORY_ID,
"owner_id": config["owner"],
"chef_id": config["chef"],
"name": config["pot_name"],
Expand Down
4 changes: 2 additions & 2 deletions indexer_app/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ async def handle_new_pot(
# Create Pot object
logger.info(f"creating pot with owner {owner_id}....")
pot_defaults = {
"pot_factory_account": predecessorId,
"pot_factory_id": predecessorId,
"deployer": signer,
"deployed_at": created_at,
"source_metadata": data["source_metadata"],
Expand All @@ -174,7 +174,7 @@ async def handle_new_pot(
"registry_provider": data["registry_provider"],
"min_matching_pool_donation_amount": data[
"min_matching_pool_donation_amount"
],
] or "0",
"sybil_wrapper_provider": data["sybil_wrapper_provider"],
"custom_sybil_checks": data.get("custom_sybil_checks"),
"custom_min_threshold_score": data.get("custom_min_threshold_score"),
Expand Down
2 changes: 1 addition & 1 deletion pots/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.conf import settings

BASE_PATTERN = (
r"potlock\.testnet"
r"v\d+\.potfactory\.potlock\.testnet"
if settings.ENVIRONMENT == "testnet"
else r"v\d+\.potfactory\.potlock\.near"
)
Expand Down
Loading