Skip to content

Commit

Permalink
fix: make requests work again
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Sep 19, 2023
1 parent cc416d3 commit 07d5c5b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ape_safe/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ def add(cli_ctx, network, address, alias):
)

if click.confirm("Add safe"):
cli_ctx.account_manager.containers["safe"].save_account(alias, address)
container = cli_ctx.account_manager.containers["safe"]
container.save_account(alias, address)

cli_ctx.logger.success(f"Safe '{address}' ({alias}) added.")


@cli.command(short_help="Stop tracking a locally-tracked Safe")
Expand All @@ -96,6 +99,8 @@ def remove(cli_ctx, alias):
if click.confirm(f"Remove safe {address} ({alias})"):
safe_container.delete_account(alias)

cli_ctx.logger.success(f"Safe '{address}' ({alias}) removed.")


def _execute_callback(ctx, param, val):
if isinstance(val, str):
Expand Down Expand Up @@ -138,7 +143,7 @@ def pending(cli_ctx, network, sign_with_local_signers, execute, alias):
# Add signatures, if was requested to do so.
if sign_with_local_signers and len(confirmations) < safe.confirmations_required:
safe.add_signatures(safe_tx, confirmations)
cli_ctx.logger.success(f"Added signature to transaction {safe_tx.nonce}")
cli_ctx.logger.success(f"Signature added to 'Transaction {safe_tx.nonce}'.")

if not execute:
signatures = safe.get_api_confirmations(safe_tx)
Expand Down
1 change: 1 addition & 0 deletions ape_safe/accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ def call( # type: ignore[override]
return super().call(txn, **call_kwargs)

def get_api_confirmations(self, safe_tx: SafeTx) -> Dict[AddressType, MessageSignature]:
safe_tx.to = safe_tx.to or ZERO_ADDRESS
safe_tx_hash = hash_eip712_message(safe_tx).hex()
try:
client_confirmations = self.client.get_confirmations(safe_tx_hash)
Expand Down

0 comments on commit 07d5c5b

Please sign in to comment.