Skip to content

Commit

Permalink
Merge pull request #1973 from nervosnetwork/hotfix/0.34.2
Browse files Browse the repository at this point in the history
hotfix 0.34.2
  • Loading branch information
kellyshang authored Dec 31, 2020
2 parents dd6ffb1 + 6bbb9a5 commit 6bb7961
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 23 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# 0.34.2 (2020-12-31)

[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.

### Hotfix

* Update the CKB logo.
* Rename the default network name to `Default`.
* Fix version updater error when clicking the install button too soon.
* Fix bug of `too many open files` error.


# 0.34.1 (2020-12-19)

[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.
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.34.1",
"version": "0.34.2",
"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.34.1",
"version": "0.34.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.34.1",
"version": "0.34.2",
"private": true,
"author": {
"name": "Nervos Core Dev",
Expand Down
19 changes: 9 additions & 10 deletions packages/neuron-ui/src/widgets/Icons/Nervos.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions packages/neuron-wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"productName": "Neuron",
"description": "CKB Neuron Wallet",
"homepage": "https://www.nervos.org/",
"version": "0.34.1",
"version": "0.34.2",
"private": true,
"author": {
"name": "Nervos Core Dev",
Expand Down Expand Up @@ -85,7 +85,7 @@
"electron-notarize": "0.2.1",
"jest-when": "2.7.2",
"lint-staged": "9.2.5",
"neuron-ui": "0.34.1",
"neuron-ui": "0.34.2",
"rimraf": "3.0.0",
"ttypescript": "1.5.10"
}
Expand Down
5 changes: 4 additions & 1 deletion packages/neuron-wallet/src/controllers/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ export default class UpdateController {
})

autoUpdater.on('download-progress', progress => {
this.notify(progress.percent / 100)
const progressPercent = progress.percent / 100
if (progressPercent !== 1) {
this.notify(progressPercent)
}
})

autoUpdater.on('update-downloaded', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/neuron-wallet/src/services/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const presetNetworks: { selected: string, networks: Network[] } = {
networks: [
{
id: 'mainnet',
name: 'Mainnet',
name: 'Default',
remote: 'http://localhost:8114',
genesisHash: MAINNET_GENESIS_HASH,
type: NetworkType.Default,
Expand Down
23 changes: 19 additions & 4 deletions packages/neuron-wallet/src/services/sdk-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,29 @@ import CKB from '@nervosnetwork/ckb-sdk-core'
import https from 'https'
import http from 'http'

let httpsAgent: https.Agent
let httpAgent: http.Agent

const getHttpsAgent = () => {
if (!httpsAgent) {
httpsAgent = new https.Agent({ keepAlive: true })
}
return httpsAgent
}

const getHttpAgent = () => {
if (!httpAgent) {
httpAgent = new http.Agent({ keepAlive: true })
}
return httpAgent
}

export const generateCKB = (url: string): CKB => {
const ckb = new CKB(url)
if (url.startsWith('https')) {
const httpsAgent = new https.Agent({ keepAlive: true })
ckb.rpc.setNode({ url, httpsAgent })
ckb.rpc.setNode({ url, httpsAgent: getHttpsAgent() })
} else {
const httpAgent = new http.Agent({ keepAlive: true })
ckb.rpc.setNode({ url, httpAgent })
ckb.rpc.setNode({ url, httpAgent: getHttpAgent() })
}
return ckb
}
Expand Down
4 changes: 2 additions & 2 deletions packages/neuron-wallet/tests/services/networks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ describe(`Unit tests of networks service`, () => {
})

describe(`validation on network existence`, () => {
it(`create network with existing name of Mainnet`, () => {
expect(service.create('Mainnet', 'http://localhost:8114')).rejects.toThrowError(t(ERROR_MESSAGE.NAME_USED))
it(`create network with existing name of Default`, () => {
expect(service.create('Default', 'http://localhost:8114')).rejects.toThrowError(t(ERROR_MESSAGE.NAME_USED))
})

it(`update network which is not existing`, () => {
Expand Down

0 comments on commit 6bb7961

Please sign in to comment.