Skip to content

Commit

Permalink
fix: Validate root params (#79)
Browse files Browse the repository at this point in the history
Co-authored-by: Barnabas Busa <barnabas.busa@ethereum.org>
  • Loading branch information
mslipper and barnabasbusa authored Sep 26, 2024
1 parent a7d72da commit 914a808
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/package_io/sanity_check.star
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ ADDITIONAL_SERVICES_PARAMS = [
"blockscout",
]

ROOT_PARAMS = [
"chains",
"op_contract_deployer_params",
]


def deep_validate_params(plan, input_args, category, allowed_params):
if category in input_args:
Expand All @@ -56,6 +61,13 @@ def validate_params(plan, input_args, category, allowed_params):


def sanity_check(plan, optimism_config):
if type(optimism_config) != "dict":
fail("Invalid input_args type, expected dict")

for key in optimism_config.keys():
if key not in ROOT_PARAMS:
fail("Invalid parameter {0}, allowed fields: {1}".format(key, ROOT_PARAMS))

chains = optimism_config.get("chains", [])

if type(chains) != "list":
Expand Down

0 comments on commit 914a808

Please sign in to comment.