Skip to content

Commit

Permalink
test auto removing key containers
Browse files Browse the repository at this point in the history
  • Loading branch information
rebelArtists committed Oct 29, 2024
1 parent 807f6aa commit b6e8f9a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/prefunded_accounts/get_prefunded_accounts.star
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ def get_accounts(plan, mnemonic, num_of_keys=21):
PRE_FUNDED_ACCOUNTS = []
plan.print("mnemonic: {0}".format(mnemonic))
for current_key in range(num_of_keys):
private_key_service_name = f"run-ethereal-private-key-{current_key}"
eth_address_service_name = f"run-ethereal-eth-address-{current_key}"

private_key = plan.run_sh(
name="run-ethereal-private-key",
name=private_key_service_name,
image=IMAGE,
description="Running ethereal to derive private keys of key {0}".format(
current_key
Expand All @@ -20,7 +23,7 @@ def get_accounts(plan, mnemonic, num_of_keys=21):
),
)
eth_address = plan.run_sh(
name="run-ethereal-eth-address",
name=eth_address_service_name,
image=IMAGE,
description="Running ethereal to derive eth address of key {0}".format(
current_key
Expand All @@ -29,6 +32,12 @@ def get_accounts(plan, mnemonic, num_of_keys=21):
mnemonic, current_key
),
)

# Clean up the private key service
plan.remove_service(private_key_service_name)

# Clean up the eth address service
plan.remove_service(eth_address_service_name)

PRE_FUNDED_ACCOUNTS.append(
new_prefunded_account.new_prefunded_account(
Expand Down

0 comments on commit b6e8f9a

Please sign in to comment.