Skip to content

Commit

Permalink
Rename 'force' to 'non_interactive' for clarity.
Browse files Browse the repository at this point in the history
  • Loading branch information
derekpierre committed Aug 23, 2024
1 parent d981059 commit a7ce192
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
18 changes: 9 additions & 9 deletions deployment/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,11 +480,11 @@ class Transactor:
Represents an ape account plus validated/annotated transaction execution.
"""

def __init__(self, account: typing.Optional[AccountAPI] = None, force: bool = False):
if force and not account:
raise ValueError("'force' can only be used if 'account' is provided")
def __init__(self, account: typing.Optional[AccountAPI] = None, non_interactive: bool = False):
if non_interactive and not account:
raise ValueError("'non_interactive' can only be used if an account is provided")

self._force = force
self._non_interactive = non_interactive
if account is None:
self._account = select_account()
else:
Expand All @@ -507,7 +507,7 @@ def transact(self, method: ContractTransactionHandler, *args) -> ReceiptAPI:
message = f"{base_message} with no arguments"
print(message)

if not self._force:
if not self._non_interactive:
_continue()

result = method(
Expand All @@ -534,9 +534,9 @@ def __init__(
path: Path,
verify: bool,
account: typing.Optional[AccountAPI] = None,
force: bool = False,
non_interactive: bool = False,
):
super().__init__(account, force)
super().__init__(account, non_interactive)

check_plugins()
self.path = path
Expand All @@ -554,7 +554,7 @@ def __init__(
self.verify = verify
self._print_deployment_info()

if not self._force:
if not self._non_interactive:
# Confirms the start of the deployment.
_continue()

Expand Down Expand Up @@ -597,7 +597,7 @@ def _deploy_contract(
self, container: ContractContainer, resolved_params: OrderedDict
) -> ContractInstance:
contract_name = container.contract_type.name
if not self._force:
if not self._non_interactive:
_confirm_resolution(resolved_params, contract_name)
deployment_params = [container, *resolved_params.values()]
kwargs = self._get_kwargs()
Expand Down
5 changes: 4 additions & 1 deletion scripts/ci/deploy_child.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ def main():
test_account = accounts.test_accounts[0]

deployer = Deployer.from_yaml(
filepath=CONSTRUCTOR_PARAMS_FILEPATH, verify=VERIFY, account=test_account, force=True
filepath=CONSTRUCTOR_PARAMS_FILEPATH,
verify=VERIFY,
account=test_account,
non_interactive=True,
)

mock_polygon_child = deployer.deploy(project.MockPolygonChild)
Expand Down

0 comments on commit a7ce192

Please sign in to comment.