Skip to content

Commit

Permalink
fix: specify file path when reading artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
MegaRedHand committed Nov 1, 2024
1 parent 73c06d1 commit 221ff5d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion kurtosis_package/keys.star
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ def generate_keys(plan, egnkey_service_name, key_type, artifact_name):
}

if key_type == "ecdsa":
address = shared_utils.read_json_artifact(plan, artifact_name, ".address")
address = shared_utils.read_json_artifact(
plan, artifact_name, ".address", file_path="keys/1.ecdsa.key.json"
)
# Prepend the address with "0x" manually
keys_info["address"] = "0x" + address

Expand Down
6 changes: 4 additions & 2 deletions kurtosis_package/shared_utils.star
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ def generate_artifact(plan, context, artifact_name):
return artifact


def read_json_artifact(plan, artifact_name, json_field):
def read_json_artifact(plan, artifact_name, json_field, file_path="*.json"):
input_dir = "/_input"
result = plan.run_sh(
image="badouralix/curl-jq",
run="jq -j {field} {input}/*.json".format(field=json_field, input=input_dir),
run="jq -j {field} {input}/{path}".format(
field=json_field, input=input_dir, path=file_path
),
files={input_dir: artifact_name},
wait="1s",
)
Expand Down

0 comments on commit 221ff5d

Please sign in to comment.