Skip to content

Commit

Permalink
Return bytes instead HexStr
Browse files Browse the repository at this point in the history
  • Loading branch information
moisses89 committed Jan 17, 2024
1 parent 22e9b87 commit 25676bd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
3 changes: 1 addition & 2 deletions safe_cli/operators/hw_wallets/hw_wallet.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import re
from abc import ABC, abstractmethod

from eth_typing import HexStr
from web3.types import TxParams

from .constants import BIP32_ETH_PATTERN, BIP32_LEGACY_LEDGER_PATTERN
Expand Down Expand Up @@ -50,7 +49,7 @@ def sign_typed_hash(self, domain_hash: bytes, message_hash: bytes) -> bytes:
@abstractmethod
def get_signed_raw_transaction(
self, tx_parameters: TxParams, chain_id: int
) -> HexStr:
) -> bytes:
"""
:param chain_id:
Expand Down
7 changes: 4 additions & 3 deletions safe_cli/operators/hw_wallets/ledger_wallet.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import Optional

from eth_typing import ChecksumAddress, HexStr
from eth_typing import ChecksumAddress
from hexbytes import HexBytes
from ledgerblue.Dongle import Dongle
from ledgereth import create_transaction, sign_typed_data_draft
from ledgereth.accounts import get_account_by_path
Expand Down Expand Up @@ -54,7 +55,7 @@ def sign_typed_hash(self, domain_hash: bytes, message_hash: bytes) -> bytes:
@raise_ledger_exception_as_hw_wallet_exception
def get_signed_raw_transaction(
self, tx_parameters: TxParams, chain_id: int
) -> HexStr:
) -> bytes:
"""
:param chain_id:
Expand All @@ -73,4 +74,4 @@ def get_signed_raw_transaction(
sender_path=self.derivation_path,
dongle=self.dongle,
)
return signed_transaction.raw_transaction()
return HexBytes(signed_transaction.raw_transaction())
6 changes: 3 additions & 3 deletions safe_cli/operators/hw_wallets/trezor_wallet.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from functools import lru_cache

import rlp
from eth_typing import ChecksumAddress, HexStr
from eth_typing import ChecksumAddress
from hexbytes import HexBytes
from trezorlib import tools
from trezorlib.client import TrezorClient, get_default_client
Expand Down Expand Up @@ -61,7 +61,7 @@ def sign_typed_hash(self, domain_hash: bytes, message_hash: bytes) -> bytes:
@raise_trezor_exception_as_hw_wallet_exception
def get_signed_raw_transaction(
self, tx_parameters: TxParams, chain_id: int
) -> HexStr:
) -> bytes:
"""
:param chain_id:
Expand Down Expand Up @@ -131,4 +131,4 @@ def get_signed_raw_transaction(
]
).hex()

return HexStr(encoded_transaction)
return HexBytes(encoded_transaction)

0 comments on commit 25676bd

Please sign in to comment.