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

safe-global / safe-cli / 9710288199

28 Jun 2024 09:04AM UTC coverage: 88.58% (+0.009%) from 88.571%
9710288199

push

github

web-flow
Remove exception invalid method name in tx-builder (#429)

831 of 952 branches covered (87.29%)

Branch coverage included in aggregate %.

9 of 9 new or added lines in 2 files covered. (100.0%)

2861 of 3216 relevant lines covered (88.96%)

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