From 92541a7ecc658d334e9f9de845483406472c6708 Mon Sep 17 00:00:00 2001 From: Kieran Prasch Date: Wed, 27 Sep 2023 14:51:18 +0200 Subject: [PATCH] (optionally) Ingest interactive account selection into Deployer --- deployment/params.py | 5 ++++- scripts/lynx/deploy_child.py | 1 - scripts/lynx/deploy_root.py | 1 - 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/deployment/params.py b/deployment/params.py index 5576d4eb..16269007 100644 --- a/deployment/params.py +++ b/deployment/params.py @@ -6,6 +6,7 @@ from ape import chain, project from ape.api import AccountAPI +from ape.cli import get_user_selected_account from ape.contracts.base import ( ContractContainer, ContractInstance @@ -291,8 +292,10 @@ class Deployer: __DEPLOYER_ACCOUNT: AccountAPI = None - def __init__(self, account: AccountAPI, params_path: Path, publish: bool): + def __init__(self, params_path: Path, publish: bool, account: typing.Optional[AccountAPI] = None): self.constructor_parameters = ConstructorParameters.from_file(params_path) + if account is None: + account = get_user_selected_account() self._set_deployer(account) self.publish = publish diff --git a/scripts/lynx/deploy_child.py b/scripts/lynx/deploy_child.py index c35a37cc..7bb81743 100644 --- a/scripts/lynx/deploy_child.py +++ b/scripts/lynx/deploy_child.py @@ -1,7 +1,6 @@ #!/usr/bin/python3 from ape import project -from ape.cli import get_user_selected_account from deployment.constants import ( ARTIFACTS_DIR, diff --git a/scripts/lynx/deploy_root.py b/scripts/lynx/deploy_root.py index 4331b2ca..56fed947 100644 --- a/scripts/lynx/deploy_root.py +++ b/scripts/lynx/deploy_root.py @@ -1,7 +1,6 @@ #!/usr/bin/python3 from ape import project -from ape.cli import get_user_selected_account from deployment.constants import ( ARTIFACTS_DIR,