Skip to content

Internal Test #343

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 70 commits into
base: onekey
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
960d7aa
feat: support scdo & alephium
ByteZhang1024 Aug 23, 2024
949a4ac
chore: release version 1.0.10-alpha.3
ByteZhang1024 Aug 23, 2024
c283495
feat: support scdo、ton、alephium address
ByteZhang1024 Aug 23, 2024
dc6e7f4
fix: scdo sign tx
ByteZhang1024 Aug 26, 2024
8cda6e9
feat: support ada sign message
ByteZhang1024 Aug 26, 2024
3beffbd
chore: release version 1.0.10-alpha.4
ByteZhang1024 Aug 26, 2024
7609340
chore: optimize scdo sign tx
ByteZhang1024 Aug 26, 2024
9d367d3
chore: release version 1.0.10-alpha.5
ByteZhang1024 Aug 26, 2024
998cdc8
chore: scdo path
ByteZhang1024 Aug 26, 2024
7dc885d
fix: scdo sign tx
ByteZhang1024 Aug 27, 2024
4d36324
chore: release version 1.0.10-alpha.6
ByteZhang1024 Aug 27, 2024
e2922a8
feat: update ton sign message
ByteZhang1024 Aug 28, 2024
15b1870
chore: release version 1.0.0-alpha.7
ByteZhang1024 Aug 28, 2024
7bd7135
feat: support pro homescreen
ByteZhang1024 Aug 28, 2024
ce7c55e
chore: release version 1.0.0-alpha.8
ByteZhang1024 Aug 28, 2024
d579fb9
chore: alephium sign message example
ByteZhang1024 Aug 28, 2024
831bc8b
feat: support scdo hex data
ByteZhang1024 Aug 29, 2024
466734e
feat: support ton sign message israwdata
ByteZhang1024 Sep 2, 2024
822d59c
chore: release version 1.0.0-alpha.9
ByteZhang1024 Sep 2, 2024
1cc7e10
feat: alephium get address add pubkey
ByteZhang1024 Sep 4, 2024
95f8e42
chore: release version 1.0.0-alpha.10
ByteZhang1024 Sep 4, 2024
dd107d9
feat: Alephium get address add params
originalix Sep 9, 2024
1edf388
chore: update version
originalix Sep 9, 2024
cdc38e5
chore: optimize ton example params
ByteZhang1024 Sep 10, 2024
468f427
chore: optimize alephium address
ByteZhang1024 Sep 10, 2024
aba2bd8
chore: optimize monitor
ByteZhang1024 Jul 5, 2024
623bb15
feat: support multiple message
ByteZhang1024 Feb 26, 2024
5a4b35e
feat: add error test
ByteZhang1024 Apr 9, 2024
66208f2
fix: sdk url
ByteZhang1024 Jul 21, 2024
532342d
chore: fix basic error
ByteZhang1024 Aug 5, 2024
9c8d557
Merge branch onekey into test/api
wabicai Oct 24, 2024
cb199e2
fix: upload api: deviceGetInfo, deviceReadSEPublicCert
wabicai Oct 24, 2024
3f2b8a5
chore: update classic 1s & pro protobuf
ByteZhang1024 Oct 24, 2024
b79fe36
chore: WriteSEPrivateKey api
wabicai Oct 25, 2024
600faca
fix: update submodule
wabicai Oct 25, 2024
8451165
fix: allow DeviceSESignMessage in bootloader
wabicai Oct 25, 2024
9604754
fix: allow deviceVerify in bootloader mode
wabicai Oct 25, 2024
4a2921f
fix: add @uiw/react-watermark package
wabicai Jan 17, 2025
da7c5b0
Fix/response-pub (#378)
wabicai Nov 12, 2024
0a26b1e
Fix: all network error (#380)
ByteZhang1024 Nov 14, 2024
d22d8e9
Optimize: release the device when an error is encountered (#381)
ByteZhang1024 Nov 19, 2024
725fcf6
Feat: add benfen chain (#383)
wabicai Nov 28, 2024
0a08108
Feat/benfen (#385)
wabicai Nov 29, 2024
711a2a9
fix: return address with BFC type (#386)
wabicai Dec 2, 2024
0f84446
Fix/benfen (#389)
wabicai Dec 2, 2024
6426455
fix: benfen address (#390)
wabicai Dec 4, 2024
9bbbc90
fix: ada publickey test case (#391)
ByteZhang1024 Dec 5, 2024
afaa1df
chore: add mock data (#393)
ByteZhang1024 Dec 11, 2024
a58ee5c
Chore: optimize request & ton version limit (#394)
ByteZhang1024 Dec 13, 2024
9c7ac94
Fix: error (#395)
ByteZhang1024 Dec 16, 2024
2d05c39
fix: optimize hardware example (#392)
wabicai Dec 18, 2024
f5715f1
Fix/benfen-message (#396)
wabicai Dec 18, 2024
6948aeb
feat: sol sign message (#397)
ByteZhang1024 Dec 30, 2024
2f4b9a1
chore: release version 1.0.17 (#399)
ByteZhang1024 Dec 31, 2024
da0270c
feat: add release url (#398)
wabicai Dec 31, 2024
415a940
fix: merge onekey branch with core/index.ts
wabicai Jan 17, 2025
a2c132d
Merge branch 'onekey' into test/api
wabicai Feb 28, 2025
68293bb
fix: getMessages with unknown type
wabicai Mar 5, 2025
c930842
fix: test case
ByteZhang1024 Mar 19, 2025
cc67a7b
Merge branch 'onekey' into test/api
wabicai Mar 19, 2025
68ae7cf
Merge branch 'onekey' into test/api
wabicai Mar 19, 2025
c0af43e
fix: test/api use onekey branch api
wabicai Mar 20, 2025
4050139
fix: test case
ByteZhang1024 Mar 19, 2025
332e5da
fix: added test/api only api
wabicai Mar 21, 2025
e4e47a6
Revert "fix: added test/api only api"
wabicai Mar 26, 2025
5dfb313
Merge branch 'onekey' into test/api
wabicai Mar 26, 2025
7db9af0
feat: test/api only api
wabicai Mar 26, 2025
9890a67
chore: test jenkins
wabicai Mar 28, 2025
3986f4e
chore: optimize test case
ByteZhang1024 May 16, 2025
14cb834
fix: fix build error
wabicai Jun 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"dev:common": "cd ./packages/hd-common-connect-sdk && yarn dev",
"dev:core": "cd ./packages/core && yarn dev",
"dev:transport": "cd ./packages/hd-transport && yarn dev",
"dev:transport-http": "cd ./packages/hd-transport-web && yarn dev",
"dev:transport-http": "cd ./packages/hd-transport-http && yarn dev",
"dev:transport-rn": "cd ./packages/hd-transport-react-native && yarn dev",
"dev:transport-lowlevel": "cd ./packages/hd-transport-lowlevel && yarn dev",
"dev:transport-webusb": "cd ./packages/hd-transport-webusb && yarn dev",
Expand Down
3,332 changes: 1,572 additions & 1,760 deletions packages/connect-examples/electron-example/yarn.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/connect-examples/expo-example/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { TamaguiProvider, PortalProvider, Text, Stack, Card } from 'tamagui';
import * as ExpoLinking from 'expo-linking';
import { SafeAreaProvider, useSafeAreaInsets } from 'react-native-safe-area-context';

import Watermark from '@uiw/react-watermark';
import { useIntl } from 'react-intl';
import SDKProvider from './src/provider/SDKProvider';

Expand Down
3 changes: 2 additions & 1 deletion packages/connect-examples/expo-example/locale/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"tab__address_test": "Address Test",
"tab__security_check": "Security Check",
"tab__functional_testing": "Functional testing",
"tab__api_export_test": "ApiExport Test",

"action__search_device": "Search Device",
"action__clean_device": "Disconnect Device",
Expand All @@ -25,6 +26,7 @@
"action__update_restart": "Restart installation update",

"action__start_test": "Start Test",
"action__start_error_test": "Testing failed cases",
"action__stop_test": "Stop Test",

"tip__update_ready": "There are new versions that can be updated",
Expand Down Expand Up @@ -100,7 +102,6 @@

"label__device_bootloader_statue": "Bootloader",
"label__device_firmware_status": "Firmware",

"label__device_se_info": "Device SE Information",
"label__device_info_update_time": "Update Time",
"label__device_info_refresh": "Refreshing Device Information",
Expand Down
7 changes: 3 additions & 4 deletions packages/connect-examples/expo-example/locale/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"tab__address_test": "地址测试",
"tab__security_check": "安全检查",
"tab__functional_testing": "功能测试",
"tab__api_export_test": "API 范围测试",

"action__search_device": "搜索设备",
"action__clean_device": "断开连接",
Expand All @@ -25,6 +26,7 @@
"action__update_restart": "重启并安装更新",

"action__start_test": "开始测试",
"action__start_error_test": "测试失败用例",
"action__stop_test": "停止测试",

"tip__update_ready": "检测到新的版本可以更新,点击进行安装",
Expand All @@ -41,7 +43,7 @@
"tip__no_select_file": "未选择文件",
"tip__update_success": "更新成功",

"title__common_parameters": "常用参数",
"title__common_parameters": "通用参数 (每次请求都会使用)",
"title__hardware_api_test": "硬件 API 测试",
"title__updating": "正在更新",
"title__input_pin": "输入 PIN",
Expand Down Expand Up @@ -101,7 +103,6 @@

"label__device_bootloader_statue": "Bootloader 状态",
"label__device_firmware_status": "开机状态",

"label__device_se_info": "设备 SE 信息",
"label__device_info_update_time": "更新时间",
"label__device_info_refresh": "刷新设备信息",
Expand Down Expand Up @@ -157,7 +158,6 @@
"message__address_not_match": "地址不匹配",
"message__create": "创建",
"message__generate": "生成",

"message__passphrase_count_test_describe": "开始之后根据提示解锁硬件, 根据硬件提示确认 passphrase, 不用自己输入",
"message__passphrase_count_test_step1": "1. 从零开始创建钱包 passphrase 并记录下来,注意在硬件按确认 passphrase",
"message__passphrase_count_test_step2": "2. 每次创建完一个 passphrase 钱包,都会去检查一遍之前创建过的钱包,是否可以正常获取地址",
Expand All @@ -166,7 +166,6 @@
"message__passphrase_special_test_describe": "请输入与当前设备一致的助记词",
"message__test_device_create_wallet_describe": "在硬件上创建钱包,将助记词输入在这里,用来验证硬件的助记词是否正确",
"message__test_blind_signature_security_check_describe": "检查钱包盲签安全性,是否可以使用规定 CoinType 之外的私钥签名",

"message__message_is_empty": "请先输入设备的助记词",

"ignore": "忽略"
Expand Down
1 change: 1 addition & 0 deletions packages/connect-examples/expo-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"@tamagui/config": "1.90.2",
"@tamagui/lucide-icons": "1.90.2",
"@ton/core": "^0.57.0",
"@uiw/react-watermark": "^1.0.1",
"asyncstorage-down": "^4.2.0",
"bitcoinjs-lib": "^6.1.5",
"bn.js": "^5.2.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,10 @@ export function useRunnerTest<T>(config: RunnerConfig<T>) {
}
}
endTestRunner();
} catch (e) {
console.log('error', e);
} catch (e: any) {
stopTest();
console.log('error', e);
alert(e.message);
}
}, [
setRunnerLogs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,46 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import * as Clipboard from 'expo-clipboard';
import { Group, H4, Stack, Text } from 'tamagui';
import { useIntl } from 'react-intl';
import { IDeviceType } from '@onekeyfe/hd-core';
import PlaygroundExecutor, { type MethodPayload } from './PlaygroundExecutor';
import { useExpandMode } from '../provider/ExpandModeProvider';
import { Button } from './ui/Button';
import AutoWrapperTextArea from './ui/AutoWrapperTextArea';

export type TestDeviceType = IDeviceType | 'common';

export interface TestExpect {
skip?: boolean;
success?: boolean;
requestPin?: boolean;
requestButton?: boolean;
unknownMessage?: boolean;
error?: boolean | number;
}

export interface TestModalExpect {
normal?: TestExpect;
bootloader?: TestExpect;
}

export type TestDeviceExpect = {
[key in TestDeviceType]?: TestModalExpect;
};

export interface PresupposeProps {
title: string;
value: any; // JSON object

expect?: TestDeviceExpect;
}

export type PlaygroundProps = {
description: string;
presupposes?: PresupposeProps[];
deprecated?: boolean;

// eslint-disable-next-line react/no-unused-prop-types
expect?: TestDeviceExpect;
} & MethodPayload;

const Playground = ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const HeaderView = () => {
padding="$3"
justifyContent="space-between"
>
<H3>Hardware Example</H3>
<H3>Example (Private Test)</H3>

<XStack minHeight={40} gap="$2">
<MenuButtons visibleItems={visibleItems} currentRoute={route.name} navigate={navigate} />
Expand Down
29 changes: 19 additions & 10 deletions packages/connect-examples/expo-example/src/components/ui/Page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ScrollView, View } from 'tamagui';
import Watermark from '@uiw/react-watermark';
import HeaderView from './Header';

export interface PageViewProps {
Expand All @@ -7,16 +8,24 @@ export interface PageViewProps {
}

const PageView = ({ children, scrollable = true }: PageViewProps) => (
<View flex={1} backgroundColor="bgApp">
<HeaderView />
{scrollable ? (
<ScrollView flex={1} testID="page-view-scrollable" overflow="scroll">
{children}
</ScrollView>
) : (
<View testID="page-view-non-scrollable">{children}</View>
)}
</View>
<Watermark
content="测试使用,需要特殊 Bridge"
fontColor="rgb(255 0 0 / 15%)"
gapX={480}
gapY={480}
fontSize={28}
>
<View flex={1} backgroundColor="bgApp">
<HeaderView />
{scrollable ? (
<ScrollView flex={1} testID="page-view-scrollable" overflow="scroll">
{children}
</ScrollView>
) : (
<View testID="page-view-non-scrollable">{children}</View>
)}
</View>
</Watermark>
);

export default PageView;
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
import { version } from '../../package.json';

export const CONNECT_SRC = process.env.CONNECT_SRC || `https://jssdk.onekey.so/${version}/`;
export const CONNECT_SRC = process.env.CONNECT_SRC || `https://jssdk.onekeytest.com/`;
94 changes: 94 additions & 0 deletions packages/connect-examples/expo-example/src/data/basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,70 @@ const api: PlaygroundProps[] = [
description: 'Search for devices',
noConnIdReq: true,
noDeviceIdReq: true,
expect: {
common: {
normal: {
success: true,
},
bootloader: {
success: true,
},
},
},
},
{
method: 'getFeatures',
description: 'Get features of a device',
noDeviceIdReq: true,
expect: {
common: {
normal: {
success: true,
},
bootloader: {
success: true,
},
},
},
},
{
method: 'getOnekeyFeatures',
description: 'Get features of a device',
noDeviceIdReq: true,
expect: {
common: {
normal: {
success: true,
},
bootloader: {
success: true,
},
},
classic: {
normal: {
unknownMessage: true,
},
bootloader: {
unknownMessage: true,
},
},
classic1s: {
normal: {
unknownMessage: true,
},
bootloader: {
unknownMessage: true,
},
},
mini: {
normal: {
unknownMessage: true,
},
bootloader: {
unknownMessage: true,
},
},
},
},
{
method: 'getPassphraseState',
Expand All @@ -26,23 +80,63 @@ const api: PlaygroundProps[] = [
method: 'cancel',
description: 'Cancel a request',
noDeviceIdReq: true,
expect: {
common: {
normal: {
skip: true,
},
bootloader: {
skip: true,
},
},
},
},
{
method: 'checkBridgeStatus',
description: 'Check bridge status of a device',
noConnIdReq: true,
noDeviceIdReq: true,
expect: {
common: {
normal: {
skip: true,
},
bootloader: {
skip: true,
},
},
},
},
{
method: 'checkBridgeRelease',
description: 'Check bridge release of a device',
noDeviceIdReq: true,
expect: {
common: {
normal: {
skip: true,
},
bootloader: {
skip: true,
},
},
},
},
{
method: 'getLogs',
description: 'get logs',
noDeviceIdReq: true,
noConnIdReq: true,
expect: {
common: {
normal: {
success: true,
},
bootloader: {
success: true,
},
},
},
},
];

Expand Down
Loading