Skip to content
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

[ᚬmaster] Rc/v0.25.1 #1142

Merged
merged 38 commits into from
Nov 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
2a45e63
fix(neuron-ui): remove /s from difficulty units
Keith-CY Nov 15, 2019
4ee11e4
docs: Update CKB node guide link
ashchan Nov 16, 2019
e8aa042
Merge pull request #1132 from Keith-CY/fix-difficulty-units
ashchan Nov 16, 2019
b445a0c
feat(neuron-ui): update the i18n texts of nervos dao.
Keith-CY Nov 16, 2019
0572d0b
Merge pull request #1134 from Keith-CY/update-nervos-dao-i18n
Keith-CY Nov 16, 2019
646cf8f
feat(neuron-ui): update the pagination style
Keith-CY Nov 16, 2019
1f25d00
Merge pull request #1135 from Keith-CY/update-style-of-pagination
ashchan Nov 16, 2019
219d99c
fix: sync when start node
classicalliu Nov 16, 2019
82a0c8d
Merge pull request #1136 from nervosnetwork/fix-sync-when-start-node
ashchan Nov 16, 2019
819793a
feat: Do not update network info too often
ashchan Nov 16, 2019
e73d4fe
test: Remove timeout before/after each network test
ashchan Nov 16, 2019
507131b
feat: Only update network's genesis hash and chain when they're
ashchan Nov 16, 2019
54eda3a
Merge pull request #1137 from nervosnetwork/lazy-update-network
ashchan Nov 16, 2019
476d101
Revert "fix(neuron-ui): fix the missing of password request dialog"
ashchan Nov 16, 2019
f9b3c15
Revert "feat(neuron-ui): hide the general settings and redirect to wa…
ashchan Nov 16, 2019
429be9c
feat: Add a clear cache button on general settings view
ashchan Nov 16, 2019
7419d37
feat(neuron-ui): add clear cache button on the general settings
Keith-CY Nov 17, 2019
7dfe670
feat: Show popup message when clearing cache finishes
ashchan Nov 17, 2019
afde49d
feat: start/stop syncing with sync controller
ashchan Nov 17, 2019
83ff29d
feat: Delete cell db files when clearing cache
ashchan Nov 17, 2019
38aa4c4
feat: Add description for clear cache feature
ashchan Nov 17, 2019
a3e66bd
refactor: Check sqlite file name with path.extname
ashchan Nov 17, 2019
06b030e
fix: set restart start number to -1
classicalliu Nov 17, 2019
6947864
fix: Genesis block should be scanned when next scan range
ashchan Nov 17, 2019
33562dc
Merge pull request #1138 from nervosnetwork/clean-cache-feature
ashchan Nov 17, 2019
0bbc822
Merge pull request #1140 from nervosnetwork/fix-restart-start-number
ashchan Nov 18, 2019
d354a7d
Merge pull request #1141 from nervosnetwork/fix-genesis-txs-scan-bug
ashchan Nov 18, 2019
dd48b47
chore: Bump to v0.25.1
ashchan Nov 18, 2019
736a65f
fix: only resetEndBlockNumber if number > 0
classicalliu Nov 18, 2019
441f173
Merge pull request #1144 from nervosnetwork/fix-regenerate
ashchan Nov 18, 2019
ac5209c
fix: Filter address by version (mainnet/testnet) when updating
ashchan Nov 18, 2019
eb9f2a0
refactor: Delete check-and-save
ashchan Nov 18, 2019
8be3d62
refactor: No need to check address version
ashchan Nov 18, 2019
3ed944c
fix: Mainnet check function call
ashchan Nov 18, 2019
8d58a11
refactor: Delete AddressDao.findByAddress
ashchan Nov 18, 2019
f29938a
Merge pull request #1146 from nervosnetwork/fix-address-version-issue
ashchan Nov 18, 2019
bd3e35b
docs: Update changelog for v0.25.1
ashchan Nov 18, 2019
56d4a34
refactor: Delete sqlite by clearing tables instead of
ashchan Nov 18, 2019
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
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
## [0.25.1](https://github.com/nervosnetwork/neuron/compare/v0.25.0...v0.25.1) (2019-11-18)


### Bug Fixes

* Genesis block should be scanned when next scan range ([6947864](https://github.com/nervosnetwork/neuron/commit/6947864)), closes [#1](https://github.com/nervosnetwork/neuron/issues/1)
* set restart start number to -1 ([06b030e](https://github.com/nervosnetwork/neuron/commit/06b030e))
* sync when start node ([219d99c](https://github.com/nervosnetwork/neuron/commit/219d99c))
* **neuron-ui:** remove /s from difficulty units ([2a45e63](https://github.com/nervosnetwork/neuron/commit/2a45e63))


### Features

* Add a clear cache button on general settings view ([429be9c](https://github.com/nervosnetwork/neuron/commit/429be9c))
* Add description for clear cache feature ([38aa4c4](https://github.com/nervosnetwork/neuron/commit/38aa4c4))
* Delete cell db files when clearing cache ([83ff29d](https://github.com/nervosnetwork/neuron/commit/83ff29d))
* Do not update network info too often ([819793a](https://github.com/nervosnetwork/neuron/commit/819793a))
* Only update network's genesis hash and chain when they're actually fetched from RPC and valid ([507131b](https://github.com/nervosnetwork/neuron/commit/507131b))
* Show popup message when clearing cache finishes ([7dfe670](https://github.com/nervosnetwork/neuron/commit/7dfe670))
* start/stop syncing with sync controller ([afde49d](https://github.com/nervosnetwork/neuron/commit/afde49d))
* **neuron-ui:** add clear cache button on the general settings ([7419d37](https://github.com/nervosnetwork/neuron/commit/7419d37))
* **neuron-ui:** update the i18n texts of nervos dao. ([b445a0c](https://github.com/nervosnetwork/neuron/commit/b445a0c))
* **neuron-ui:** update the pagination style ([646cf8f](https://github.com/nervosnetwork/neuron/commit/646cf8f))



# [0.25.0](https://github.com/nervosnetwork/neuron/compare/v0.24.5...v0.25.0) (2019-11-16)


Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ $ yarn bootstrap

### Start Neuron

A local CKB node is required for Neuron wallet to talk to it via RPC APIs and get data. Please follow the [Nervos CKB doc](https://docs.nervos.org/getting-started/introduction) to get CKB node up and running first.
A local CKB node is required for Neuron wallet to talk to it via RPC APIs and get data. Please follow the [Nervos CKB doc](https://docs.nervos.org/references/neuron-wallet-guide.html#1-run-a-ckb-mainnet-node) to get CKB node up and running first.

### Start Neuron in Development Mode

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.25.0",
"version": "0.25.1",
"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.25.0",
"version": "0.25.1",
"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.25.0",
"version": "0.25.1",
"private": true,
"author": {
"name": "Nervos Core Dev",
Expand Down
4 changes: 2 additions & 2 deletions packages/neuron-ui/src/components/CustomRows/DAORecordRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const DAORecord = ({
metaInfo = t('nervos-dao.blocks-left', {
epochs: localNumberFormatter(epochs),
blocks: localNumberFormatter(currentEpochInfo.length - currentEpochInfo.index),
days: localNumberFormatter(epochs / BigInt(6)),
days: localNumberFormatter(Math.round(Number(epochs) / 6)),
})
}
}
Expand Down Expand Up @@ -153,7 +153,7 @@ const DAORecord = ({
</div>
<div className={styles.secondaryInfo}>
<span>{`APC: ~${apc}%`}</span>
<span>{uniformTimeFormatter(+timestamp)}</span>
<span>{t('nervos-dao.deposit-at', { time: uniformTimeFormatter(+timestamp) })}</span>
<span>{metaInfo}</span>
</div>
</div>
Expand Down
45 changes: 41 additions & 4 deletions packages/neuron-ui/src/components/GeneralSetting/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,45 @@
import React from 'react'
import { Stack } from 'office-ui-fabric-react'
import React, { useCallback, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { Stack, PrimaryButton, Spinner, Text } from 'office-ui-fabric-react'
import { StateWithDispatch } from 'states/stateProvider/reducer'
import { addPopup } from 'states/stateProvider/actionCreators'
import { clearCellCache } from 'services/remote'

const GeneralSetting = () => {
return <Stack tokens={{ childrenGap: 15 }} />
const GeneralSetting = ({ dispatch }: React.PropsWithoutRef<StateWithDispatch>) => {
const [t] = useTranslation()
const [clearing, setClearing] = useState(false)

const clearCache = useCallback(() => {
setClearing(true)
setTimeout(() => {
clearCellCache().finally(() => {
addPopup('clear-cache-successfully')(dispatch)
setClearing(false)
})
}, 100)
}, [dispatch])

return (
<Stack tokens={{ childrenGap: 15 }}>
<Stack horizontal horizontalAlign="start">
<PrimaryButton
onClick={clearCache}
disabled={clearing}
ariaDescription="Create new network configuration"
styles={{
root: {
minWidth: 150,
},
}}
>
{clearing ? <Spinner /> : t('settings.general.clear-cache')}
</PrimaryButton>
</Stack>
<Text as="p" variant="medium">
{t('settings.general.clear-cache-description')}
</Text>
</Stack>
)
}

GeneralSetting.displayName = 'GeneralSetting'
Expand Down
40 changes: 30 additions & 10 deletions packages/neuron-ui/src/components/NervosDAO/DepositDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import React, { useMemo } from 'react'
import {
Stack,
Dialog,
Expand All @@ -7,13 +7,15 @@ import {
Text,
DefaultButton,
PrimaryButton,
ActionButton,
DialogType,
DialogFooter,
Spinner,
SpinnerSize,
} from 'office-ui-fabric-react'
import { useTranslation } from 'react-i18next'
import { SHANNON_CKB_RATIO } from 'utils/const'
import { useTranslation, Trans } from 'react-i18next'
import { SHANNON_CKB_RATIO, NERVOS_DAO_RFC_URL } from 'utils/const'
import { openExternal } from 'services/remote'

const DepositDialog = ({
show,
Expand All @@ -28,6 +30,28 @@ const DepositDialog = ({
errorMessage,
}: any) => {
const [t] = useTranslation()
const rfcLink = useMemo(
() => (
<ActionButton
styles={{
root: {
height: 20,
margin: 0,
padding: 0,
textDecoration: 'underline',
fontSize: 14,
color: 'rgb(0, 120, 212)',
},
label: {
margin: 0,
},
}}
onClick={() => openExternal(NERVOS_DAO_RFC_URL)}
ariaLabel="Nervos DAO RFC"
/>
),
[]
)
const maxValue = +(BigInt(balance) / BigInt(SHANNON_CKB_RATIO)).toString()

if (!show) {
Expand Down Expand Up @@ -63,13 +87,9 @@ const DepositDialog = ({
<Text as="h2" variant="large">
{`${t('nervos-dao.notice')}:`}
</Text>
{t('nervos-dao.deposit-terms')
.split('\n')
.map(term => (
<Text as="p" key={term}>
{term}
</Text>
))}
<Text as="p">
<Trans i18nKey="nervos-dao.deposit-terms" components={[rfcLink]} />
</Text>
</Stack>
<DialogFooter>
<DefaultButton onClick={onDismiss} text={t('nervos-dao.cancel')} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,17 @@ const WithdrawDialog = ({
? t('nervos-dao.notice-wait-time', {
epochs: localNumberFormatter(epochs),
blocks: localNumberFormatter(currentEpochInfo.length - currentEpochInfo.index),
days: localNumberFormatter(epochs / BigInt(6)),
days: localNumberFormatter(Math.round(Number(epochs) / 6)),
})
: ''

const alert =
epochs <= BigInt(5) && epochs >= BigInt(0)
? t('nervos-dao.withdraw-alert', {
epochs,
hours: epochs * BigInt(4),
days: (epochs + BigInt(180)) / BigInt(6),
epochs: localNumberFormatter(epochs),
hours: localNumberFormatter(epochs * BigInt(4)),
nextLeftEpochs: localNumberFormatter(epochs + BigInt(180)),
days: localNumberFormatter(Math.round((Number(epochs) + 180) / 6)),
})
: ''

Expand Down
2 changes: 1 addition & 1 deletion packages/neuron-ui/src/components/NervosDAO/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ const NervosDAO = ({
return (
<>
<Text as="h2" variant="xxLarge">
{t('nervos-dao.deposit-receipts')}
{t('nervos-dao.deposit-records')}
</Text>
<Stack>
{records.map((record, i) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/neuron-ui/src/components/Settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { WalletWizardPath } from 'components/WalletWizard'
import { Routes } from 'utils/const'

const pivotItems = [
// { label: 'settings.setting-tabs.general', url: Routes.SettingsGeneral },
{ label: 'settings.setting-tabs.general', url: Routes.SettingsGeneral },
{ label: 'settings.setting-tabs.wallets', url: Routes.SettingsWallets },
{ label: 'settings.setting-tabs.network', url: Routes.SettingsNetworks },
]
Expand Down
44 changes: 17 additions & 27 deletions packages/neuron-ui/src/containers/Main/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useMemo } from 'react'
import { Route, RouteComponentProps, Switch, Redirect } from 'react-router-dom'
import { Route, RouteComponentProps } from 'react-router-dom'
import { useTranslation } from 'react-i18next'

import { useState } from 'states/stateProvider'
Expand Down Expand Up @@ -102,12 +102,12 @@ export const mainContents: CustomRouter.Route[] = [
exact: false,
comp: ImportKeystore,
},
// {
// name: `PasswordRequest`,
// path: '/',
// exact: false,
// comp: PasswordRequest,
// },
{
name: `PasswordRequest`,
path: '/',
exact: false,
comp: PasswordRequest,
},
{
name: `NervosDAO`,
path: Routes.NervosDAO,
Expand Down Expand Up @@ -158,26 +158,16 @@ const MainContent = ({

return (
<>
<Route
path="/"
key="PasswordRequest"
render={routerProps => {
return <PasswordRequest {...routerProps} {...neuronWalletState} dispatch={dispatch} />
}}
/>
<Switch>
<Redirect from={Routes.SettingsGeneral} to={Routes.SettingsWallets} />
{mainContents.map(container => (
<Route
exact={container.exact}
path={`${container.path}${container.params || ''}`}
key={container.name}
render={routerProps => {
return <container.comp {...routerProps} {...neuronWalletState} dispatch={dispatch} />
}}
/>
))}
</Switch>
{mainContents.map(container => (
<Route
exact={container.exact}
path={`${container.path}${container.params || ''}`}
key={container.name}
render={routerProps => {
return <container.comp {...routerProps} {...neuronWalletState} dispatch={dispatch} />
}}
/>
))}
</>
)
}
Expand Down
25 changes: 12 additions & 13 deletions packages/neuron-ui/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@
"network": "Network"
},
"general": {
"skip-data-and-type": "Skip the Cells which contain Data or Type Script",
"clear-cache": "Clear cache",
"clear-cache-description": "Clear cache if you encounter data sync or balance display problems. Neuron will rescan block data.",
"show": "Show",
"hide": "Hide"
},
Expand Down Expand Up @@ -257,6 +258,7 @@
"delete-wallet-successfully": "The wallet was deleted",
"create-network-successfully": "The network was created",
"update-network-successfully": "The network was updated",
"clear-cache-successfully": "The cache was cleared",
"addr-copied": "Address has been copied to the clipboard",
"qrcode-copied": "QR Code has been copied to the clipboard",
"view-the-run-node-doc": "View the guide in browser",
Expand Down Expand Up @@ -319,29 +321,26 @@
"free": "Free",
"locked": "Locked",
"deposit": "Deposit",
"deposit-receipts": "Deposit Receipts",
"deposit-records": "Deposit Records",
"apc": "APC",
"deposit-at": "Deposit at {{time}}",
"claim": "Claim",
"withdraw": "Withdraw",
"fee": "Transaction fee",
"deposit-to-nervos-dao": "Deposit to Nervos DAO",
"withdraw-from-nervos-dao": "Withdraw from Nervos DAO",
"notice": "Notice",
"cancel": "Cancel",
"proceed": "Proceed",
"deposit-value": "Deposit",
"compensation": "Compensation",
"notice-wait-time": "Notice: You need to wait {{epochs}} epochs {{blocks}} blocks(~{{days}} days) to claim the saving.",
"deposit-terms": "Nervos DAO needs 102 CKB for receipt storage, which is not compensation-bearing.\nNervos DAO is a system layer decentralized infrastructure. Your saving here is secure.\nAccording to the Nervos DAO protocol, you need at least 180 epochs to withdraw your deposit.",
"deposited-action-label": "Withdraw",
"withdrawing-action-label": "Claim",
"minimal-fee-required": "The minimum deposit capacity is {{minimal}} CKB",
"notice-wait-time": "Notice: You need to wait {{epochs}} epochs {{blocks}} blocks(~{{days}} days) to complete the withdraw.",
"deposit-terms": "Nervos DAO needs 102 CKBytes for deposit cell storage, which is not compensation-bearing. Please visit the <0>Nervos DAO RFC</0> for more information about Nervos DAO",
"deposited-action-label": "Request withdraw",
"withdrawing-action-label": "Withdraw",
"minimal-fee-required": "The minimum deposit capacity is {{minimal}} CKBytes",
"compensation-accumulated": "{{blockNumber}} blocks compensation accumulated",
"blocks-left": "{{epochs}} epochs {{blocks}} blocks left(~{{days}} days)",
"withdraw-alert": "Hint: these are only {{epochs}} epochs (~{{hours}} hours) left to the next deposit claim period. If your start withdrawing transaction is not confirmed before that, your deposit will be locked until the next period (~{{days}} days). And you won’t get more compensation for the prolonged lock period.",
"insufficient-period-alert-title": "Insufficient Period",
"insufficient-period-alert-message": "Nervos DAO needs at least 4 epochs to handle your request."
"withdraw-alert": "Hint: these are only {{epochs}} epochs (~{{hours}} hours) until the end of your current lock period. If you wish to withdraw in current lock period, please send withdraw request in time. There are {{nextLeftEpochs}} epochs(~{{days}} days) until the end of your next lock period.",
"insufficient-period-alert-title": "Referenced Header is Invalid",
"insufficient-period-alert-message": "Only mature header can be referenced in transactions(Matureness requires 4 epochs)"
}
}
}
Loading