|
2 | 2 | from ape.cli import ConnectedProviderCommand, account_option, ape_cli_context |
3 | 3 | from ape.types import AddressType |
4 | 4 |
|
5 | | -from ape_safe._cli.click_ext import safe_argument |
| 5 | +from ape_safe.cli import execute_safetx_flag, safe_argument |
6 | 6 |
|
7 | 7 |
|
8 | 8 | @click.group() |
@@ -35,29 +35,29 @@ def guard(safe): |
35 | 35 | @ape_cli_context() |
36 | 36 | @account_option() |
37 | 37 | @safe_argument |
38 | | -@click.option("--propose", is_flag=True, default=False) |
| 38 | +@execute_safetx_flag() |
39 | 39 | @click.argument("module") |
40 | | -def enable(cli_ctx, safe, account, module, propose): |
| 40 | +def enable(cli_ctx, safe, account, module, execute_safetx): |
41 | 41 | """ |
42 | 42 | Enable MODULE for SAFE |
43 | 43 |
|
44 | 44 | **WARNING**: This is a potentially destructive action and may make your safe vulnerable. |
45 | 45 | """ |
46 | 46 | module = cli_ctx.conversion_manager.convert(module, AddressType) |
47 | | - safe.modules.enable(module, submitter=account, propose=propose) |
| 47 | + safe.modules.enable(module, submitter=account, propose=not execute_safetx) |
48 | 48 |
|
49 | 49 |
|
50 | 50 | @modules.command(cls=ConnectedProviderCommand) |
51 | 51 | @ape_cli_context() |
52 | 52 | @account_option() |
53 | 53 | @safe_argument |
54 | | -@click.option("--propose", is_flag=True, default=False) |
| 54 | +@execute_safetx_flag() |
55 | 55 | @click.argument("module") |
56 | | -def disable(cli_ctx, safe, account, module, propose): |
| 56 | +def disable(cli_ctx, safe, account, module, execute_safetx): |
57 | 57 | """ |
58 | 58 | Disable MODULE for SAFE |
59 | 59 |
|
60 | 60 | **WARNING**: This is a potentially destructive action and may impact operations of your safe. |
61 | 61 | """ |
62 | 62 | module = cli_ctx.conversion_manager.convert(module, AddressType) |
63 | | - safe.modules.disable(module, submitter=account, propose=propose) |
| 63 | + safe.modules.disable(module, submitter=account, propose=not execute_safetx) |
0 commit comments