Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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 .github/workflows/check-code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
cache: "yarn"

- name: Restore
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
node_modules
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
cache: "yarn"

- name: Restore
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
node_modules
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
cache: "yarn"

- name: Restore
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
node_modules
Expand All @@ -51,7 +51,7 @@ jobs:

- name: Add msbuild to PATH
if: matrix.os == 'windows-2019'
uses: microsoft/setup-msbuild@v1.3.1
uses: microsoft/setup-msbuild@v2
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/package_for_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
cache: "yarn"

- name: Restore
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
node_modules
Expand All @@ -62,7 +62,7 @@ jobs:

- name: Add msbuild to PATH
if: matrix.os == 'windows-2019'
uses: microsoft/setup-msbuild@v1.3.1
uses: microsoft/setup-msbuild@v2
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"

Expand Down Expand Up @@ -225,7 +225,7 @@ jobs:

- name: Comment by pull request comment event
if: ${{ github.event_name == 'issue_comment' }}
uses: peter-evans/create-or-update-comment@v3
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ github.event.comment.id }}
body: |
Expand All @@ -242,7 +242,7 @@ jobs:
steps:
- name: Comment by pull request comment event when package failed
if: ${{ github.event_name == 'issue_comment' }}
uses: peter-evans/create-or-update-comment@v3
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ github.event.comment.id }}
body: Packageing failed in [${{ github.run_id }}](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}). @${{ github.event.comment.user.login }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
cache: "yarn"

- name: Restore
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
node_modules
Expand Down
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
# 0.116.0 (2024-05-24)

### CKB Node & Light Client

- [CKB@v0.116.1](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 Client@v0.3.7](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)

---

[![Neuron@v0.116.0](https://github.com/Magickbase/neuron-public-issues/assets/7271329/ec10aa01-47fe-47a3-9636-3d4e86fc6c9b)](https://youtu.be/QXv8by2C8zU)

YouTube: https://youtu.be/QXv8by2C8zU

---

## New features

- 3134: Support 'replace-by-fee' nervos dao transactions and sudt transactions.(@devchenyan)
- 3144: Reduce size of light client log in debug information and reveal start-block-number in log.(@yanguoyu)
- 3064: Support locking window by pin code.(@yanguoyu)
- 3131: Add detailed result for nervos dao transaction.(@devchenyan)

## Bug fixes

- 3121: Locate the first transaction on Explorer directly when users want to set the start-block-number for light client.(@yanguoyu)
- 3101: Show migration instruction properly.(@devchenyan)
- 3062: Migrate legacy ACP to active ACP account(@yanguoyu)
- 3141: Fix some issues about light client synchronizaiton.(@yanguoyu)
- 3120: Remove all sync data when start-block-number is set less than before.(@yanguoyu)

**Full Changelog**: https://github.com/nervosnetwork/neuron/compare/v0.114.3...v0.116.0

# 0.114.3 (2024-04-16)

### CKB Node & Light Client
Expand Down
16 changes: 16 additions & 0 deletions compatible.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,22 @@
"0.3",
"0.2"
]
},
"0.116": {
"full": [
"0.116",
"0.115",
"0.114",
"0.113",
"0.112",
"0.111",
"0.110",
"0.109"
],
"light": [
"0.3",
"0.2"
]
}
}
}
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.114.3",
"version": "0.116.0",
"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.114.3",
"version": "0.116.0",
"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.114.3",
"version": "0.116.0",
"private": true,
"author": {
"name": "Nervos Core Dev",
Expand Down
31 changes: 22 additions & 9 deletions packages/neuron-ui/src/components/AmendSend/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,28 +96,41 @@ const AmendSend = () => {
return ''
}

const inputsCapacity = useMemo(() => {
if (transaction) {
return transaction.inputs.reduce((total, cur) => {
return total + BigInt(cur.capacity || '0')
}, BigInt(0))
}
return undefined
}, [transaction])

const items: {
address: string
amount: string
capacity: string
isLastOutput: boolean
output: State.DetailedOutput
}[] = useMemo(() => {
if (transaction && transaction.outputs.length) {
if (transaction && transaction.outputs.length && inputsCapacity) {
const lastOutputAddress = getLastOutputAddress(transaction.outputs)
return transaction.outputs.map(output => {
const address = scriptToAddress(output.lock, { isMainnet })
const capacity =
transaction.outputs.length === 1 && address === lastOutputAddress
? (inputsCapacity - fee).toString()
: output.capacity
return {
capacity: output.capacity,
capacity,
address,
output,
amount: shannonToCKBFormatter(output.capacity || '0'),
amount: shannonToCKBFormatter(capacity || '0'),
isLastOutput: address === lastOutputAddress,
}
})
}
return []
}, [transaction?.outputs])
}, [transaction?.outputs, inputsCapacity, fee])

const outputsCapacity = useMemo(() => {
const outputList = items.length === 1 ? items : items.filter(item => !item.isLastOutput)
Expand All @@ -129,15 +142,15 @@ const AmendSend = () => {
const totalAmount = shannonToCKBFormatter(outputsCapacity.toString())

const lastOutputsCapacity = useMemo(() => {
if (transaction) {
const inputsCapacity = transaction.inputs.reduce((total, cur) => {
return total + BigInt(cur.capacity || '0')
}, BigInt(0))
if (inputsCapacity) {
if (items.length === 1) {
return BigInt(items[0].capacity || '0')
}

return inputsCapacity - outputsCapacity - fee
}
return undefined
}, [transaction, fee, outputsCapacity])
}, [inputsCapacity, fee, outputsCapacity, items])

useEffect(() => {
if (transaction && lastOutputsCapacity !== undefined) {
Expand Down
24 changes: 15 additions & 9 deletions packages/neuron-ui/src/components/FormattedTokenAmount/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type FormattedTokenAmountProps = { item: State.Transaction; show: boolean; symbo
type AmountProps = Omit<FormattedTokenAmountProps, 'isNeedCopy'> & {
sudtAmount?: string
isReceive: boolean
amount: string
amount?: string
symbolClassName?: string
}

Expand All @@ -30,18 +30,18 @@ const Amount = ({ sudtAmount, show, item, isReceive, amount, symbolClassName, sy
</div>
) : (
<div>
<span className={show ? styles.amount : ''} data-direction={isReceive ? 'receive' : 'send'}>
{amount}
<span className={show ? styles.amount : ''} data-direction={amount && (isReceive ? 'receive' : 'send')}>
{amount ?? '--'}
</span>
&nbsp;{symbol}
&nbsp;{amount ? symbol : ''}
</div>
)
}

export const FormattedTokenAmount = ({ item, show, symbolClassName }: FormattedTokenAmountProps) => {
let amount = '--'
let amount: string | undefined
let sudtAmount = ''
let copyText = amount
let copyText: string | undefined = amount
let isReceive = false
let symbol = ''

Expand All @@ -61,16 +61,22 @@ export const FormattedTokenAmount = ({ item, show, symbolClassName }: FormattedT
isReceive = !sudtAmount.includes('-')
}
} else {
amount = show ? `${shannonToCKBFormatter(item.value, true)}` : `${HIDE_BALANCE}`
isReceive = !amount.includes('-')
amount = show
? `${shannonToCKBFormatter(item.nervosDao ? item.daoCapacity ?? '--' : item.value, true)}`
: `${HIDE_BALANCE}`
isReceive = !amount?.includes('-')
copyText = `${amount} CKB`
symbol = 'CKB'
if (item.nervosDao && item.daoCapacity === undefined) {
amount = undefined
copyText = undefined
}
}
}

const props = { sudtAmount, show, item, isReceive, amount, symbolClassName, symbol }

return show ? (
return show && copyText ? (
<CopyZone content={copyText}>
<Amount {...props} />
</CopyZone>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ $action-button-width: 11.25rem;
gap: 16px;

.content {
width: 176px;
min-width: 176px;
padding: 16px;
background: var(--input-disabled-color);
border-radius: 8px;
Expand Down
2 changes: 1 addition & 1 deletion packages/neuron-ui/src/components/History/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const History = () => {
sortable: true,
},
{
title: t('history.table.amount'),
title: t('history.table.asset'),
dataIndex: 'amount',
align: 'left',
isBalance: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/neuron-ui/src/components/Overview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ const Overview = () => {
},
},
{
title: t('overview.amount'),
title: t('overview.asset'),
dataIndex: 'amount',
align: 'left',
isBalance: true,
Expand Down
44 changes: 41 additions & 3 deletions packages/neuron-ui/src/components/SyncStatus/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React, { useCallback, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { SyncStatus as SyncStatusEnum, ConnectionStatus, clsx, localNumberFormatter, getSyncLeftTime } from 'utils'
import { Confirming, NewTab } from 'widgets/Icons/icon'
import { Confirming, NewTab, Question } from 'widgets/Icons/icon'
import { ReactComponent as UnexpandStatus } from 'widgets/Icons/UnexpandStatus.svg'
import { ReactComponent as StartBlock } from 'widgets/Icons/StartBlock.svg'
import Tooltip from 'widgets/Tooltip'
import { openExternal } from 'services/remote'
import styles from './syncStatus.module.scss'

const SyncDetail = ({
Expand Down Expand Up @@ -53,7 +54,17 @@ const SyncDetail = ({
</div>
) : null}
<div className={styles.item}>
<div className={styles.title}>{t('network-status.left-time')}</div>
<div className={styles.title}>
{t('network-status.left-time')}:
<Tooltip
tip={<div className={styles.leftTimeTip}>{t('network-status.left-time-tip')}</div>}
className={styles.question}
tipClassName={styles.questionTip}
placement="right-bottom"
>
<Question />
</Tooltip>
</div>
<div className={styles.number}>{getSyncLeftTime(estimate)}</div>
</div>
{isLightClient && (
Expand Down Expand Up @@ -114,7 +125,34 @@ const SyncStatus = ({
}

if (ConnectionStatus.Offline === connectionStatus) {
return <span className={styles.redDot}>{t('sync.sync-failed')}</span>
return (
<span className={styles.redDot}>
{t('sync.sync-failed')}
<Tooltip
tip={
<div className={styles.failedDetail}>
{t('sync.sync-failed-detail')}
&nbsp;&nbsp;
<button
type="button"
onClick={() => {
openExternal(`https://neuron.magickbase.com/posts/issues/2893`)
}}
className={styles.openHelper}
>
{t('sync.learn-more')}
</button>
</div>
}
trigger="click"
placement="left-bottom"
showTriangle
tipClassName={styles.helpTip}
>
<Question />
</Tooltip>
</span>
)
}

if (SyncStatusEnum.SyncNotStart === syncStatus) {
Expand Down
Loading