Skip to content

Sign approve_hash with hardware wallets - #12

Open
techdigger wants to merge 1 commit into
mainfrom
approve-hash-hardware-wallet
Open

techdigger wants to merge 1 commit into
mainfrom
approve-hash-hardware-wallet

Conversation

@techdigger

@techdigger techdigger commented Nov 16, 2026 •

Copy link
Copy Markdown
  • Ran the tests
  • Ran pre-commit on the changed files

What was wrong?

approve_hash calls sender_account.sign_transaction. Local accounts have that method; Ledger and Trezor senders don't, so the call raises AttributeError and a hardware-wallet owner can't approve a Safe transaction hash on chain.

How was it fixed?

  • When the sender has get_signed_raw_transaction, sign with it, as HwWalletManager.execute_safe_tx already does.
  • Local accounts are unchanged.
  • A test approves a hash with a mock hardware wallet: an object with address and get_signed_raw_transaction only, signing with a test key. It fails on the current code with AttributeError.

approve_hash calls sender_account.sign_transaction. Local accounts have
that method. Ledger and Trezor senders don't, so the call raises
AttributeError and a hardware-wallet owner can't approve a Safe
transaction hash on chain.

Sign with the hardware wallet's get_signed_raw_transaction when the
sender has it, as execute_safe_tx does.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant