Skip to content

Commit 42e0fb2

Browse files
authored
Merge pull request #1884 from nervosnetwork/rc/v0.33.0
Rc/v0.33.0
2 parents e652426 + 5df42ce commit 42e0fb2

File tree

16 files changed

+221
-28
lines changed

16 files changed

+221
-28
lines changed

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
# 0.33.0 (2020-10-12)
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+
**Note:** There will be a data migration for the new bundled node [CKB v0.35.1](https://github.com/nervosnetwork/ckb/releases/tag/v0.35.1), which may take several minutes to boot up for the first time after upgraded from the earlier versions.
6+
**Attention:** The migration is not reversible. Please backup the data directory if you want to use old versions later.
7+
8+
### Refactor
9+
10+
* Upgrade from Electron 7 to Electron 9.
11+
* Refactor the wallet address storage to be based on an SQLite table rather than a JSON file.
12+
* Deprecate LevelDB and instead SQLite for persisting transaction descriptions.
13+
* Refactor send component.
14+
* Reduce the confirmation block height from 300 to 24.
15+
16+
### New features
17+
18+
* Enable `Asset Accounts` for mainnet.
19+
* Support transfer to multisig address.
20+
21+
### Bug fixes
22+
23+
* Fixed `InsufficientCellCapacity` error for CKB ACP transfer when there are cells with data.
24+
* Fixed `too many SQL variables` error when there are too many addresses in wallets.
25+
* Fixed the autofill description on unlocking assets.
26+
* Refine error message when the fee for dao withdrawal transaction is insufficient.
27+
28+
129
# 0.33.0-rc1 (2020-09-27)
230

331
This is a release candidate to preview the changes in the next official release and may not be stable. Welcome any questions or suggestions.

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.0-rc1",
5+
"version": "0.33.0",
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.0-rc1",
5+
"version": "0.33.0",
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.0-rc1",
3+
"version": "0.33.0",
44
"private": true,
55
"author": {
66
"name": "Nervos Core Dev",

packages/neuron-wallet/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"productName": "Neuron",
44
"description": "CKB Neuron Wallet",
55
"homepage": "https://www.nervos.org/",
6-
"version": "0.33.0-rc1",
6+
"version": "0.33.0",
77
"private": true,
88
"author": {
99
"name": "Nervos Core Dev",
@@ -79,7 +79,7 @@
7979
"electron-notarize": "0.2.1",
8080
"jest-when": "2.7.2",
8181
"lint-staged": "9.2.5",
82-
"neuron-ui": "0.33.0-rc1",
82+
"neuron-ui": "0.33.0",
8383
"rimraf": "3.0.0",
8484
"ttypescript": "1.5.10"
8585
}

packages/neuron-wallet/src/block-sync-renderer/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ let syncTask: SyncTask | null
2525
let network: Network | null
2626

2727
const resetSyncTaskQueue = queue(async ({startTask, clearIndexerFolder}) => {
28+
await WalletService.getInstance().generateAddressesIfNecessary()
2829
await killBlockSyncTask()
2930
if (startTask) {
3031
await createBlockSyncTask(clearIndexerFolder)
@@ -121,9 +122,6 @@ export const createBlockSyncTask = async (clearIndexerFolder: boolean) => {
121122
})
122123

123124
if (network.genesisHash !== EMPTY_GENESIS_HASH) {
124-
await WalletService.getInstance().generateAddressesIfNecessary()
125-
126-
// re init txCount in addresses if switch network
127125
syncTask!.start(
128126
network.remote,
129127
network.genesisHash,

packages/neuron-wallet/src/database/chain/entities/hd-public-key-info.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@ export default class HdPublicKeyInfo {
1414
@Index()
1515
walletId!: string
1616

17-
@Column({
18-
type: 'varchar',
19-
})
20-
@Index()
21-
address!: string
22-
2317
@Column()
2418
addressType!: AddressType
2519

@@ -48,7 +42,6 @@ export default class HdPublicKeyInfo {
4842
const publicKeyInfo = new HdPublicKeyInfo()
4943

5044
publicKeyInfo.walletId = model.walletId
51-
publicKeyInfo.address = model.address
5245
publicKeyInfo.addressType = model.addressType
5346
publicKeyInfo.addressIndex = model.addressIndex
5447
publicKeyInfo.publicKeyInBlake160 = model.publicKeyInBlake160
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import {MigrationInterface, QueryRunner} from "typeorm";
2+
3+
export class RemoveKeyInfoAddress1601447406035 implements MigrationInterface {
4+
name = 'RemoveKeyInfoAddress1601447406035'
5+
6+
public async up(queryRunner: QueryRunner): Promise<any> {
7+
await queryRunner.dropColumn(`hd_public_key_info`, 'address');
8+
}
9+
10+
public async down(): Promise<any> {}
11+
12+
}

packages/neuron-wallet/src/database/chain/ormconfig.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import { RemoveLiveCell1592781363749 } from './migrations/1592781363749-RemoveLi
3737
import { AddIndexerTxHashCache1592727615004 } from './migrations/1592727615004-AddIndexerTxHashCache'
3838
import { HDPublicKeyInfo1598087517643 } from './migrations/1598087517643-HDPublicKeyInfo'
3939
import { TxDescription1599441769473 } from './migrations/1599441769473-TxDescription'
40+
import { RemoveKeyInfoAddress1601447406035 } from './migrations/1601447406035-RemoveKeyInfoAddress'
4041

4142
export const CONNECTION_NOT_FOUND_NAME = 'ConnectionNotFoundError'
4243

@@ -90,6 +91,7 @@ const connectOptions = async (genesisBlockHash: string): Promise<SqliteConnectio
9091
AddIndexerTxHashCache1592727615004,
9192
HDPublicKeyInfo1598087517643,
9293
TxDescription1599441769473,
94+
RemoveKeyInfoAddress1601447406035,
9395
],
9496
logger: 'simple-console',
9597
logging,

packages/neuron-wallet/src/models/keys/hd-public-key-info.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,35 @@
1-
import Address, { AddressType } from "./address"
1+
import AddressGenerator from "models/address-generator"
2+
import SystemScriptInfo from "models/system-script-info"
3+
import NetworksService from "services/networks"
4+
import Address, { AddressPrefix, AddressType } from "./address"
25

36
export default class HdPublicKeyInfoModel {
47
public walletId: string
5-
public address: string
68
public addressType: AddressType
79
public addressIndex: number
810
public publicKeyInBlake160: string
911
public description?: string
1012

13+
public get address() {
14+
const prefix = NetworksService.getInstance().isMainnet() ? AddressPrefix.Mainnet : AddressPrefix.Testnet
15+
return AddressGenerator.toShort(
16+
SystemScriptInfo.generateSecpScript(this.publicKeyInBlake160),
17+
prefix
18+
)
19+
}
20+
1121
public get path(): string {
1222
return Address.pathFor(this.addressType, this.addressIndex)
1323
}
1424

1525
constructor(
1626
walletId: string,
17-
address: string,
1827
addressType: AddressType,
1928
addressIndex: number,
2029
publicKeyInBlake160: string,
2130
description?: string,
2231
) {
2332
this.walletId = walletId
24-
this.address = address
2533
this.addressType = addressType
2634
this.addressIndex = addressIndex
2735
this.publicKeyInBlake160 = publicKeyInBlake160
@@ -30,15 +38,13 @@ export default class HdPublicKeyInfoModel {
3038

3139
public static fromObject(params: {
3240
walletId: string,
33-
address: string,
3441
addressType: AddressType,
3542
addressIndex: number,
3643
publicKeyInBlake160: string,
3744
description?: string,
3845
}): HdPublicKeyInfoModel {
3946
return new HdPublicKeyInfoModel (
4047
params.walletId,
41-
params.address,
4248
params.addressType,
4349
params.addressIndex,
4450
params.publicKeyInBlake160,

0 commit comments

Comments
 (0)