Skip to content

Commit

Permalink
Merge pull request #1480 from nervosnetwork/rc/v0.29.0
Browse files Browse the repository at this point in the history
[ᚬmaster] Rc/v0.29.0
  • Loading branch information
ashchan authored Mar 24, 2020
2 parents a563a02 + a255220 commit e4810ce
Show file tree
Hide file tree
Showing 84 changed files with 1,534 additions and 1,276 deletions.
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
Please enter details.

**Environment (please complete the following information):**
- OS & Version: [e.g. Windows 10, macOS 10.15.2, Linux Ubuntu 18.04]
- Neuron Version [e.g. 0.28.0]
- Block Number: [Check that from `Overview` - `Blockchain Status` for v0.29.0-rc2 or before, or hover onto the left bottom syncing status area for v0.29.0 and later]

**Steps To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Screenshots**
If applicable, add screenshots to help explain your problem.
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
# 0.29.0-rc3 (2020-03-24)

This is an RC version to preview the changes in the next release.

### Bundled CKB node

CKB v0.29.0 was released on Feb 26th, 2020. This version of CKB node is now bundled and preconfigured in Neuron.

### New features

We added several new features with this version:

* Sign/Verify message: Sign a message with an address and its private key, or verify a signed message with an address and its public key.
* Customized assets: List customized assets that have non-standard cells, e.g. cells with locktime. Holders with locked assets from the genesis block would be able to view them now.
* Transaction with locktime: Send a transaction that could only be released after the locktime.
* Synced block number: Hover over the sync status area on the left bottom and check the CKB tip block number and Neuron synced block number, to see the process of the syncing.

### Performance tweak

Thanks to the community we have found and fixed a serious performance issue. Miner wallets usually receive transactions with huge amount of inputs. When syncing this kind of wallets Neuron became very slow and unresponsive, and couldn't calculate the balance correctly. With this release we've tweaked the sync process, making it run faster and handle transactions with many inputs/outputs properly.

### Bug fixes

* Fixed serveral syncing issues causing incorrect balance.
* Fixed a bug that when clearing cache transaction description would be lost.


# 0.29.0-rc2 (2020-03-10)

This is an RC version to preview the changes in the next release.
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ Nervos CKB Desktop Wallet

---

## FAQ

Got a question about Neuron? Please check out the [FAQ](https://docs.nervos.org/references/neuron-faq.html).

## Quick Start

### Prerequisites
Expand All @@ -33,6 +37,8 @@ $ yarn bootstrap

As of `v0.26.0`, Neuron bundles a CKB binary and starts it for Mainnet automatically. If you prefer to run a local CKB node yourself instead, please follow the [Nervos CKB doc](https://docs.nervos.org/references/neuron-wallet-guide.html#1-run-a-ckb-mainnet-node) to get it up and running before launching Neuron.

**Note**: If you run CKB node on Windows but it fails to start, you may need to download and install the latest [Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads).

### Start Neuron in Development Mode

```shell
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"packages": [
"packages/*"
],
"version": "0.29.0-rc2",
"version": "0.29.0-rc3",
"npmClient": "yarn",
"useWorkspaces": true
}
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.29.0-rc2",
"version": "0.29.0-rc3",
"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.29.0-rc2",
"version": "0.29.0-rc3",
"private": true,
"author": {
"name": "Nervos Core Dev",
Expand Down
5 changes: 5 additions & 0 deletions packages/neuron-ui/public/css/fonts.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,8 @@
font-family: 'SourceHanSansCN-Bold';
src: url('../fonts/SourceHanSansCN-Bold.otf') format('truetype');
}

@font-face {
font-family: 'SourceCodePro-Regular';
src: url('../fonts/SourceCodePro-Regular.ttf') format('truetype')
}
Binary file not shown.
20 changes: 16 additions & 4 deletions packages/neuron-ui/src/components/DepositDialog/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useMemo, useRef } from 'react'
import React, { useMemo, useCallback, useRef } from 'react'
import { Slider, SpinnerSize } from 'office-ui-fabric-react'
import { useTranslation, Trans } from 'react-i18next'
import TextField from 'widgets/TextField'
Expand Down Expand Up @@ -56,6 +56,18 @@ const DepositDialog = ({
[]
)
const maxValue = +(maxDepositAmount / BigInt(SHANNON_CKB_RATIO)).toString()
const disabled = !isTxGenerated

const onConfirm = useCallback(
(e: React.FormEvent) => {
e.preventDefault()
if (disabled) {
return
}
onSubmit()
},
[onSubmit, disabled]
)

if (!show) {
return null
Expand All @@ -66,7 +78,7 @@ const DepositDialog = ({
{isDepositing ? (
<Spinner size={SpinnerSize.large} />
) : (
<>
<form onSubmit={onConfirm}>
<h2 title={t('nervos-dao.deposit-dialog-title`')} className={styles.title}>
{t('nervos-dao.deposit-dialog-title')}
</h2>
Expand All @@ -92,9 +104,9 @@ const DepositDialog = ({
</div>
<div className={styles.footer}>
<Button type="cancel" onClick={onDismiss} label={t('nervos-dao.cancel')} />
<Button type="submit" onClick={onSubmit} label={t('nervos-dao.proceed')} disabled={!isTxGenerated} />
<Button type="submit" label={t('nervos-dao.proceed')} disabled={disabled} />
</div>
</>
</form>
)}
</dialog>
)
Expand Down
7 changes: 1 addition & 6 deletions packages/neuron-ui/src/components/History/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useCallback, useEffect, useMemo } from 'react'
import React, { useCallback, useMemo } from 'react'
import { useHistory, useLocation } from 'react-router-dom'
import { useTranslation } from 'react-i18next'
import { Stack, SearchBox } from 'office-ui-fabric-react'
Expand Down Expand Up @@ -34,11 +34,6 @@ const History = () => {
const isMainnet = isMainnetUtil(networks, networkID)

const { keywords, onKeywordsChange } = useSearch(search, id, dispatch)
useEffect(() => {
if (id) {
history.push(`${Routes.History}?pageNo=1&keywords=${''}`)
}
}, [id, history])
const onSearch = useCallback(() => history.push(`${Routes.History}?keywords=${keywords}`), [history, keywords])

const tipBlockNumber = useMemo(() => {
Expand Down
62 changes: 31 additions & 31 deletions packages/neuron-ui/src/components/ImportKeystore/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ const ImportKeystore = () => {
const [openingFile, setOpeningFile] = useState(false)
const goBack = useGoBack(history)

const disabled =
loading ||
!!(
!fields.name ||
!fields.path ||
!fields.password ||
fields.nameError ||
fields.passwordError ||
fields.passwordError
)

useEffect(() => {
if (fields.name === undefined) {
const name = generateWalletName(wallets, wallets.length + 1, t)
Expand Down Expand Up @@ -88,19 +99,23 @@ const ImportKeystore = () => {
})
}, [fields])

const onSubmit = useCallback(() => {
if (loading) {
return
}
setLoading(true)
setTimeout(() => {
importWalletWithKeystore({
name: fields.name || '',
keystorePath: fields.path,
password: fields.password,
})(history).finally(() => setLoading(false))
}, 200)
}, [fields.name, fields.password, fields.path, history, loading])
const onSubmit = useCallback(
(e: React.FormEvent) => {
e.preventDefault()
if (loading || disabled) {
return
}
setLoading(true)
setTimeout(() => {
importWalletWithKeystore({
name: fields.name || '',
keystorePath: fields.path,
password: fields.password,
})(history).finally(() => setLoading(false))
}, 200)
},
[fields.name, fields.password, fields.path, history, loading, disabled]
)

const onChange = useCallback(
(e: React.SyntheticEvent<HTMLInputElement>) => {
Expand Down Expand Up @@ -156,7 +171,7 @@ const ImportKeystore = () => {
)

return (
<div className={styles.container}>
<form className={styles.container} onSubmit={onSubmit}>
{Object.entries(fields)
.filter(([key]) => !key.endsWith('Error'))
.map(([key, value]) => {
Expand All @@ -181,26 +196,11 @@ const ImportKeystore = () => {
})}
<div className={styles.actions}>
<Button type="cancel" onClick={goBack} label={t('import-keystore.button.back')} />
<Button
type="submit"
onClick={onSubmit}
label={t('import-keystore.button.submit')}
disabled={
loading ||
!!(
!fields.name ||
!fields.path ||
!fields.password ||
fields.nameError ||
fields.passwordError ||
fields.passwordError
)
}
>
<Button type="submit" label={t('import-keystore.button.submit')} disabled={disabled}>
{loading ? <Spinner /> : (t('import-keystore.button.submit') as string)}
</Button>
</div>
</div>
</form>
)
}

Expand Down
5 changes: 4 additions & 1 deletion packages/neuron-ui/src/components/NervosDAO/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { MIN_DEPOSIT_AMOUNT, SyncStatus, ConnectionStatus } from 'utils/const'
import { epochParser } from 'utils/parsers'
import { backToTop } from 'utils/animations'
import getSyncStatus from 'utils/getSyncStatus'
import getCurrentUrl from 'utils/getCurrentUrl'

import DepositDialog from 'components/DepositDialog'
import WithdrawDialog from 'components/WithdrawDialog'
Expand All @@ -35,7 +36,8 @@ const NervosDAO = () => {
},
wallet,
nervosDAO: { records },
chain: { connectionStatus, tipBlockNumber: syncedBlockNumber },
chain: { connectionStatus, tipBlockNumber: syncedBlockNumber, networkID },
settings: { networks },
} = useGlobalState()
const dispatch = useDispatch()
const [t] = useTranslation()
Expand Down Expand Up @@ -124,6 +126,7 @@ const NervosDAO = () => {
tipBlockTimestamp,
syncedBlockNumber,
currentTimestamp: Date.now(),
url: getCurrentUrl(networkID, networks),
})

const MemoizedRecords = useMemo(() => {
Expand Down
Loading

0 comments on commit e4810ce

Please sign in to comment.