Skip to content

Commit

Permalink
chore: fix emulator build error and track the new code base
Browse files Browse the repository at this point in the history
  • Loading branch information
somebodyLi committed Oct 15, 2024
1 parent bc1c08d commit e4ac963
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions hwilib/devices/onekey.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,12 @@ def __init__(
self.client.ensure_model = MethodType(ensure_model, self.client)

def enumerate(
password: Optional[str] = None, expert: bool = False, chain: Chain = Chain.MAIN
password: Optional[str] = None, expert: bool = False, chain: Chain = Chain.MAIN, allow_emulators: bool = False
) -> List[Dict[str, Any]]:
results = []
devs = webusb.WebUsbTransport.enumerate(usb_ids=USB_IDS)
devs.extend(udp.UdpTransport.enumerate(path=ONEKEY_EMULATOR_PATH))
if allow_emulators:
devs.extend(udp.UdpTransport.enumerate(path=ONEKEY_EMULATOR_PATH))
for dev in devs:
d_data: Dict[str, Any] = {}

Expand Down
2 changes: 2 additions & 0 deletions test/setup_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ if [[ -n ${build_onekey_1} || -n ${build_onekey_t} ]]; then
git checkout bixin_dev
git checkout .
git pull origin bixin_dev
poetry lock --no-update
poetry install
poetry run pip install protobuf==3.20.0
export EMULATOR=1 DEBUG_LINK=1 TREZOR_TRANSPORT_V1=1
Expand All @@ -167,6 +168,7 @@ if [[ -n ${build_onekey_1} || -n ${build_onekey_t} ]]; then
git checkout .
git pull origin touch
git submodule update --init --recursive vendor/lvgl_mp
poetry lock --no-update
poetry install
cd core
poetry run make build_unix
Expand Down
2 changes: 1 addition & 1 deletion test/test_onekey.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def setUp(self):
self.dev_args = ['-t', 'onekey', '-d', "udp:127.0.0.1:54935"]

def test_label(self):
result = self.do_command(self.dev_args + ['enumerate'])
result = self.do_command(self.dev_args + ["--emulators", "enumerate"])
for dev in result:
if dev['type'] == 'onekey' and dev['path'] == "udp:127.0.0.1:54935":
self.assertEqual(dev['label'], 'test')
Expand Down

0 comments on commit e4ac963

Please sign in to comment.