Skip to content

Commit e4ac963

Browse files
committed
chore: fix emulator build error and track the new code base
1 parent bc1c08d commit e4ac963

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
@@ -147,6 +147,7 @@ if [[ -n ${build_onekey_1} || -n ${build_onekey_t} ]]; then
147147
git checkout bixin_dev
148148
git checkout .
149149
git pull origin bixin_dev
150+
poetry lock --no-update
150151
poetry install
151152
poetry run pip install protobuf==3.20.0
152153
export EMULATOR=1 DEBUG_LINK=1 TREZOR_TRANSPORT_V1=1
@@ -167,6 +168,7 @@ if [[ -n ${build_onekey_1} || -n ${build_onekey_t} ]]; then
167168
git checkout .
168169
git pull origin touch
169170
git submodule update --init --recursive vendor/lvgl_mp
171+
poetry lock --no-update
170172
poetry install
171173
cd core
172174
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)