Skip to content

Commit b010785

Browse files
authored
Merge pull request #1931 from nervosnetwork/hotfix/0.33.2
Hotfix/0.33.2
2 parents 512162b + d0822d4 commit b010785

File tree

46 files changed

+1026
-98
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1026
-98
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# 0.33.2 (2020-11-26)
2+
3+
[CKB v0.35.1](https://github.com/nervosnetwork/ckb/releases/tag/v0.35.1) was released on Sept. 14th, 2020. This version of CKB node is now bundled and preconfigured in Neuron.
4+
5+
### Hotfix
6+
7+
* Upgrade Asset Account script config.
8+
9+
### Bug fix
10+
11+
* Prevent Neuron from quitting when the main window is closed on MacOS.
12+
13+
114
# 0.33.1 (2020-11-16)
215

316
[CKB v0.35.1](https://github.com/nervosnetwork/ckb/releases/tag/v0.35.1) was released on Sept. 14th, 2020. This version of CKB node is now bundled and preconfigured in Neuron.

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"packages": [
33
"packages/*"
44
],
5-
"version": "0.33.1",
5+
"version": "0.33.2",
66
"npmClient": "yarn",
77
"useWorkspaces": true
88
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "neuron",
33
"productName": "Neuron",
44
"description": "CKB Neuron Wallet",
5-
"version": "0.33.1",
5+
"version": "0.33.2",
66
"private": true,
77
"author": {
88
"name": "Nervos Core Dev",

packages/neuron-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "neuron-ui",
3-
"version": "0.33.1",
3+
"version": "0.33.2",
44
"private": true,
55
"author": {
66
"name": "Nervos Core Dev",

packages/neuron-ui/src/components/PasswordRequest/index.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
sendTransaction,
1414
deleteWallet,
1515
backupWallet,
16+
migrateAcp,
1617
sendCreateSUDTAccountTransaction,
1718
sendSUDTTransaction,
1819
} from 'states'
@@ -93,6 +94,16 @@ const PasswordRequest = () => {
9394
})
9495
break
9596
}
97+
case 'migrate-acp': {
98+
await migrateAcp({ id: walletID, password })(dispatch).then(status => {
99+
if (isSuccessResponse({ status })) {
100+
history.push(RoutePath.History)
101+
} else if (status === ErrorCode.PasswordIncorrect) {
102+
throw new PasswordIncorrectException()
103+
}
104+
})
105+
break
106+
}
96107
case 'unlock': {
97108
if (isSending) {
98109
break
@@ -183,7 +194,7 @@ const PasswordRequest = () => {
183194
<dialog ref={dialogRef} className={styles.dialog}>
184195
<form onSubmit={onSubmit}>
185196
<h2 className={styles.title}>{t(`password-request.${actionType}.title`)}</h2>
186-
{['unlock', 'create-sudt-account', 'send-sudt'].includes(actionType ?? '') ? null : (
197+
{['unlock', 'create-sudt-account', 'send-sudt', 'migrate-acp'].includes(actionType ?? '') ? null : (
187198
<div className={styles.walletName}>{wallet ? wallet.name : null}</div>
188199
)}
189200
<TextField

packages/neuron-ui/src/components/SUDTAccountList/index.tsx

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ import {
2121
isSuccessResponse,
2222
} from 'utils'
2323

24-
import { getSUDTAccountList, generateCreateSUDTAccountTransaction, updateSUDTAccount } from 'services/remote'
24+
import {
25+
getSUDTAccountList,
26+
generateCreateSUDTAccountTransaction,
27+
updateSUDTAccount,
28+
checkMigrateAcp,
29+
} from 'services/remote'
2530

2631
import styles from './sUDTAccountList.module.scss'
2732

@@ -56,6 +61,25 @@ const SUDTAccountList = () => {
5661

5762
const existingAccountNames = accounts.filter(acc => acc.accountName).map(acc => acc.accountName || '')
5863

64+
useEffect(() => {
65+
checkMigrateAcp().then(res => {
66+
if (isSuccessResponse(res)) {
67+
if (res.result === false) {
68+
history.push(RoutePath.Overview)
69+
}
70+
} else {
71+
dispatch({
72+
type: AppActions.AddNotification,
73+
payload: {
74+
type: 'alert',
75+
timestamp: +new Date(),
76+
content: typeof res.message === 'string' ? res.message : res.message.content,
77+
},
78+
})
79+
}
80+
})
81+
}, [dispatch, history])
82+
5983
useEffect(() => {
6084
const ckbBalance = BigInt(balance)
6185
const isInsufficient = (res: { status: number }) =>

packages/neuron-ui/src/containers/Main/hooks.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,16 @@ export const useSubscription = ({
214214
})
215215
break
216216
}
217+
case 'migrate-acp': {
218+
dispatch({
219+
type: AppActions.RequestPassword,
220+
payload: {
221+
walletID: payload || '',
222+
actionType: 'migrate-acp',
223+
},
224+
})
225+
break
226+
}
217227
default: {
218228
break
219229
}

packages/neuron-ui/src/exceptions/address.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,10 @@ export class AddressEmptyException extends Error {
2222
super(`${I18N_PATH}${ErrorCode.AddressIsEmpty}`)
2323
}
2424
}
25+
26+
export class AddressDeprecatedException extends Error {
27+
public code = ErrorCode.AddressIsDeprecated
28+
constructor() {
29+
super(`${I18N_PATH}${ErrorCode.AddressIsDeprecated}`)
30+
}
31+
}

packages/neuron-ui/src/locales/en.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,9 @@
295295
},
296296
"send-sudt": {
297297
"title": "Send sUDT"
298+
},
299+
"migrate-acp": {
300+
"title": "Upgrade Asset Accounts"
298301
}
299302
},
300303
"qrcode": {
@@ -407,7 +410,8 @@
407410
"305": "$t(messages.fields.address) cannot be empty.",
408411
"306": "Please enter a mainnet address",
409412
"307": "Please enter a testnet address",
410-
"308": "Amount is not enough"
413+
"308": "Amount is not enough",
414+
"309": "The receiver needs to upgrade her account address to accept more transfer."
411415
}
412416
},
413417
"sync": {

packages/neuron-ui/src/locales/zh-tw.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,9 @@
295295
},
296296
"send-sudt": {
297297
"title": "發起 sUDT 交易"
298+
},
299+
"migrate-acp": {
300+
"title": "升级资产账户"
298301
}
299302
},
300303
"qrcode": {
@@ -407,7 +410,8 @@
407410
"305": "$t(messages.fields.address)不能為空。",
408411
"306": "請輸入主網地址",
409412
"307": "請輸入測試網地址",
410-
"308": "餘額不足"
413+
"308": "餘額不足",
414+
"309": "收款人需要升級資產賬戶才能繼續接收轉賬。"
411415
}
412416
},
413417
"sync": {

0 commit comments

Comments
 (0)