Skip to content

Commit

Permalink
Merge branch 'develop' into feat-359
Browse files Browse the repository at this point in the history
  • Loading branch information
devchenyan authored Jun 6, 2024
2 parents 8205c9a + f6b48b8 commit 1adac65
Show file tree
Hide file tree
Showing 66 changed files with 888 additions and 477 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/update_wallet_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
branch: 'chore-update-wallet-env/${{github.ref_name}}'
sha: '${{ github.event.create.head.sha }}'
sha: '${{ github.sha }}'

- name: Checkout
uses: actions/checkout@v4
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# 0.116.2 (2024-05-29)

### CKB Node & Light Client

- [[email protected]](https://github.com/nervosnetwork/ckb/releases/tag/v0.116.1) was released on May. 11st, 2024. This version of CKB node is now bundled and preconfigured in Neuron.
- [CKB Light [email protected]](https://github.com/nervosnetwork/ckb-light-client/releases/tag/v0.3.7) was released on Apr. 13th, 2024. This version of CKB Light Client is now bundled and preconfigured in Neuron

### Assumed valid target

Block before `0x6dd077b407d019a0bce0cbad8c34e69a524ae4b2599b9feda2c7491f3559d32c`(at height `13,007,704`) will be skipped in validation.(https://github.com/nervosnetwork/neuron/pull/3157)

---

## Bug fixes

- 3179: Remove the display of the ledger firmware version because it causes the Nervos app to crash on the ledger device.(@yanguoyu)

**Full Changelog**: https://github.com/nervosnetwork/neuron/compare/v0.116.1...v0.116.2

# 0.116.1 (2024-05-28)

### CKB Node & Light Client
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"packages": ["packages/*"],
"version": "0.116.1",
"version": "0.116.2",
"npmClient": "yarn",
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "neuron",
"productName": "Neuron",
"description": "CKB Neuron Wallet",
"version": "0.116.1",
"version": "0.116.2",
"private": true,
"author": {
"name": "Nervos Core Dev",
Expand Down
2 changes: 1 addition & 1 deletion packages/neuron-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "neuron-ui",
"version": "0.116.1",
"version": "0.116.2",
"private": true,
"author": {
"name": "Nervos Core Dev",
Expand Down
2 changes: 1 addition & 1 deletion packages/neuron-ui/src/components/AmendSUDTSend/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ const AmendSUDTSend = () => {
</div>
<div className={styles.rightFooter}>
<div className={styles.actions}>
<Button type="submit" disabled={disabled} label={t('send.send')}>
<Button type="submit" disabled={!!disabled} label={t('send.send')}>
{sending ? <Spinner /> : (t('send.submit-transaction') as string)}
</Button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/neuron-ui/src/components/AmendSend/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ const AmendSend = () => {
<span>{t('send.allow-use-sent-cell')}</span>
</label>
<div className={styles.actions}>
<Button type="submit" disabled={disabled} label={t('send.send')}>
<Button type="submit" disabled={!!disabled} label={t('send.send')}>
{sending ? <Spinner /> : (t('send.submit-transaction') as string)}
</Button>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useCallback, useState } from 'react'
import { useTranslation } from 'react-i18next'
import Button from 'widgets/Button'
import { getDevices, getDeviceFirmwareVersion, getDeviceCkbAppVersion, connectDevice } from 'services/remote'
import { getDevices, getDeviceCkbAppVersion, connectDevice } from 'services/remote'
import { isSuccessResponse, errorFormatter, useDidMount } from 'utils'
import { ReactComponent as SuccessInfo } from 'widgets/Icons/SuccessInfo.svg'
import { Error as ErrorIcon } from 'widgets/Icons/icon'
Expand Down Expand Up @@ -50,7 +50,6 @@ const DetectDevice = ({ dispatch, model }: { dispatch: React.Dispatch<ActionType
const [scanning, setScanning] = useState(true)
const [error, setError] = useState('')
const [appVersion, setAppVersion] = useState('')
const [firmwareVersion, setFirmwareVersion] = useState('')

const findDevice = useCallback(async () => {
setError('')
Expand All @@ -76,10 +75,6 @@ const DetectDevice = ({ dispatch, model }: { dispatch: React.Dispatch<ActionType
setScanning(false)
throw new ConnectFailedException(errorFormatter(connectionRes.message, t))
}
const firmwareVersionRes = await getDeviceFirmwareVersion(device.descriptor)
if (isSuccessResponse(firmwareVersionRes)) {
setFirmwareVersion(firmwareVersionRes.result!)
}
const ckbVersionRes = await getDeviceCkbAppVersion(device.descriptor)
if (isSuccessResponse(ckbVersionRes)) {
setAppVersion(ckbVersionRes.result!)
Expand Down Expand Up @@ -117,9 +112,6 @@ const DetectDevice = ({ dispatch, model }: { dispatch: React.Dispatch<ActionType
<h3 className={styles.model}>{productName}</h3>
{errorMsg ? <Info isError msg={errorMsg} /> : null}
{scanning ? <Info isWaiting={scanning} msg={t('import-hardware.waiting')} /> : null}
{firmwareVersion && !errorMsg && !scanning ? (
<Info msg={t('import-hardware.firmware-version', { version: firmwareVersion })} />
) : null}
{appVersion ? <Info msg={t('import-hardware.app-version', { version: appVersion })} /> : null}
</section>
<footer className={styles.dialogFooter}>
Expand Down
80 changes: 72 additions & 8 deletions packages/neuron-ui/src/components/MultisigAddress/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,21 @@ export const useConfigManage = ({ walletId, isMainnet }: { walletId: string; isM
}
})
}, [setEntities])
const updateConfig = useCallback(
const onUpdateConfig = useCallback((values: Partial<MultisigEntity> & { id: number }) => {
return updateMultisigConfig(values).then(res => {
if (isSuccessResponse(res)) {
setEntities(v => v.map(config => (res.result && config.id === res.result?.id ? res.result : config)))
} else {
throw new Error(typeof res.message === 'string' ? res.message : res.message.content!)
}
})
}, [])
const onUpdateConfigAlias = useCallback(
(id: number) => (e: React.SyntheticEvent<unknown>) => {
const { value } = e.target as HTMLInputElement
updateMultisigConfig({ id, alias: value || '' }).then(res => {
if (isSuccessResponse(res)) {
setEntities(v => v.map(config => (res.result && config.id === res.result?.id ? res.result : config)))
}
})
onUpdateConfig({ id, alias: value || '' })
},
[setEntities]
[onUpdateConfig]
)
const deleteConfigById = useCallback(
(id: number) => {
Expand Down Expand Up @@ -141,7 +146,8 @@ export const useConfigManage = ({ walletId, isMainnet }: { walletId: string; isM
return {
saveConfig,
allConfigs,
updateConfig,
onUpdateConfigAlias,
onUpdateConfig,
deleteConfigById,
onImportConfig,
configs,
Expand Down Expand Up @@ -365,3 +371,61 @@ export const useSubscription = ({
}, [isLightClient, getAndSaveMultisigSyncProgress])
return { multisigBanlances, multisigSyncProgress }
}

export const useCancelWithLightClient = () => {
const [isCloseWarningDialogShow, setIsCloseWarningDialogShow] = useState(false)
const onCancel = useCallback(() => {
setIsCloseWarningDialogShow(true)
}, [setIsCloseWarningDialogShow])
const onCancelCloseMultisigDialog = useCallback(() => {
setIsCloseWarningDialogShow(false)
}, [setIsCloseWarningDialogShow])
return {
isCloseWarningDialogShow,
onCancel,
onCancelCloseMultisigDialog,
}
}

export const useSetStartBlockNumber = ({
onUpdateConfig,
}: {
onUpdateConfig: (v: Partial<MultisigEntity> & { id: number }) => Promise<void>
}) => {
const [isSetStartBlockShown, setIsSetStartBlockShown] = useState(false)
const [editId, setEditId] = useState<number | undefined>()
const [address, setAddress] = useState<string | undefined>()
const [lastStartBlockNumber, setLastStartBlockNumber] = useState<number | undefined>()
const onConfirm = useCallback(
(startBlockNumber: number) => {
if (editId) {
return onUpdateConfig({
id: editId,
startBlockNumber,
}).then(() => {
setIsSetStartBlockShown(false)
})
}
return Promise.reject(new Error('The Edit multisig config is empty'))
},
[editId]
)
const openDialog = useCallback<React.MouseEventHandler<HTMLButtonElement>>(e => {
const { id, address: editAddress, startBlockNumber } = e.currentTarget.dataset
if (id) {
setEditId(+id)
}
setAddress(editAddress)
setLastStartBlockNumber(startBlockNumber ? +startBlockNumber : undefined)
setIsSetStartBlockShown(true)
}, [])
return {
openDialog,
closeDialog: useCallback(() => setIsSetStartBlockShown(false), []),
isSetStartBlockShown,
onConfirm,
address,
lastStartBlockNumber,
onCancel: useCallback(() => setIsSetStartBlockShown(false), []),
}
}
Loading

1 comment on commit 1adac65

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Packaging for test is done in 9394228581

Please sign in to comment.