Skip to content

Commit 9fa1996

Browse files
committed
chore: fix emulator build error and track the new code base
1 parent 67258c3 commit 9fa1996

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

hwilib/devices/onekey.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,12 @@ def __init__(
283283
self.client.ensure_model = MethodType(ensure_model, self.client)
284284

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

test/setup_environment.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ if [[ -n ${build_onekey_1} || -n ${build_onekey_t} ]]; then
145145
git checkout bixin_dev
146146
git checkout .
147147
git pull origin bixin_dev
148+
poetry lock --no-update
148149
poetry install
149150
poetry run pip install protobuf==3.20.0
150151
export EMULATOR=1 DEBUG_LINK=1 TREZOR_TRANSPORT_V1=1
@@ -165,6 +166,7 @@ if [[ -n ${build_onekey_1} || -n ${build_onekey_t} ]]; then
165166
git checkout .
166167
git pull origin touch
167168
git submodule update --init --recursive vendor/lvgl_mp
169+
poetry lock --no-update
168170
poetry install
169171
cd core
170172
poetry run make build_unix

test/test_onekey.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def setUp(self):
203203
self.dev_args = ['-t', 'onekey', '-d', "udp:127.0.0.1:54935"]
204204

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

0 commit comments

Comments
 (0)