• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

safe-global / safe-cli / 9698628578

27 Jun 2024 02:38PM CUT coverage: 88.571% (+0.07%) from 88.505%
9698628578

push

github

web-flow
Add hw wallet sign message (#420)

* Add support for sign_message HwWallet

* Add Hw wallet support on SafeOperator tx-service mode

830 of 951 branches covered (87.28%)

Branch coverage included in aggregate %.

53 of 66 new or added lines in 7 files covered. (80.3%)

1 existing line in 1 file now uncovered.

2859 of 3214 relevant lines covered (88.95%)

3.56 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.18
/src/safe_cli/operators/hw_wallets/trezor_exceptions.py
1
import functools
4✔
2

3
from trezorlib.exceptions import (
4✔
4
    Cancelled,
5
    OutdatedFirmwareError,
6
    PinException,
7
    TrezorFailure,
8
)
9
from trezorlib.transport import TransportException
4✔
10

11
from ..exceptions import HardwareWalletException
4✔
12
from .exceptions import InvalidDerivationPath
4✔
13

14

15
def raise_trezor_exception_as_hw_wallet_exception(function):
4✔
16
    @functools.wraps(function)
4✔
17
    def wrapper(*args, **kwargs):
4✔
18
        try:
4✔
19
            return function(*args, **kwargs)
4✔
20
        except TrezorFailure as e:
4✔
21
            raise HardwareWalletException(e.message)
×
22
        except OutdatedFirmwareError:
4✔
23
            raise HardwareWalletException("Trezor firmware version is not supported")
4✔
24
        except PinException:
4✔
25
            raise HardwareWalletException("Wrong PIN")
4✔
26
        except Cancelled:
4✔
27
            raise HardwareWalletException("Trezor operation was cancelled")
4✔
28
        except TransportException:
4✔
29
            raise HardwareWalletException("Trezor device is not connected")
4✔
30
        except InvalidDerivationPath as e:
×
31
            raise HardwareWalletException(e.message)
×
32

33
    return wrapper
4✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc