Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
607558b
feat: bump sdk to v0.20.0
classicalliu Sep 7, 2019
a104618
fix: fix gatherInputs select error
classicalliu Sep 7, 2019
34218d7
test: add test for get balance with alice
classicalliu Sep 7, 2019
9c12418
chore: remove useless await
classicalliu Sep 7, 2019
8ae1037
Merge pull request #910 from nervosnetwork/bump-sdk-to-v0.20.0
ashchan Sep 7, 2019
aff9386
chore: Bump to v0.20.0-beta.0
ashchan Sep 7, 2019
94af8c1
chore(deps): bump mixin-deep from 1.3.1 to 1.3.2
dependabot[bot] Sep 7, 2019
969d8da
chore(deps): bump lodash-es from 4.17.13 to 4.17.15
dependabot[bot] Sep 7, 2019
5573b85
Merge pull request #911 from nervosnetwork/dependabot/npm_and_yarn/mi…
ashchan Sep 7, 2019
ba933d0
Merge pull request #912 from nervosnetwork/dependabot/npm_and_yarn/lo…
ashchan Sep 7, 2019
66df9ab
chore(deps): Upgrade many NPM packages
ashchan Sep 7, 2019
93fc2ab
Merge pull request #913 from nervosnetwork/update-npm-deps
ashchan Sep 8, 2019
c7b8f47
chore(deps): Bump react to 16.9.0
ashchan Sep 9, 2019
ec42c07
chore(deps): Bump i18next to 17.0.13
ashchan Sep 9, 2019
6af3fb0
chore(deps): Bump electron to 6.0.7
ashchan Sep 9, 2019
29f8df3
Merge pull request #916 from nervosnetwork/bump-electron-6.0.7
ashchan Sep 9, 2019
2fcefde
Merge pull request #914 from nervosnetwork/bump-react-16.9.0
ashchan Sep 9, 2019
ed10cd1
Merge pull request #915 from nervosnetwork/bump-i18next-17.0.13
ashchan Sep 9, 2019
315e89e
refactor: Remove dependency t from useCallback hook (#917)
ashchan Sep 9, 2019
9d93935
chore(neuron-ui): clean eslint warnings
Keith-CY Sep 9, 2019
5cc20e0
Merge pull request #918 from Keith-CY/clean-eslint-warnings
ashchan Sep 9, 2019
70f4680
feat(neuron-ui): set the default font style to use system fonts
Keith-CY Sep 9, 2019
f22692e
Merge pull request #919 from Keith-CY/use-system-fonts
Keith-CY Sep 9, 2019
db6f7ea
docs: Update changelog for v0.20.0-beta.0
ashchan Sep 9, 2019
cf591ff
Merge branch 'master' into develop
ashchan Sep 9, 2019
452d5cf
Merge branch 'develop' into rc/v0.20.0-beta.0
ashchan Sep 9, 2019
239ed29
docs: Fix v0.20.0-beta.0 changelog
ashchan Sep 9, 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
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# [0.20.0-beta.0](https://github.com/nervosnetwork/neuron/compare/v0.19.0-beta.1...v0.20.0-beta.0) (2019-09-09)


### Bug Fixes

* fix gatherInputs select error ([a104618](https://github.com/nervosnetwork/neuron/commit/a104618))


### Features

* **neuron-ui:** set the default font style to use system fonts ([70f4680](https://github.com/nervosnetwork/neuron/commit/70f4680))
* bump sdk to v0.20.0 ([607558b](https://github.com/nervosnetwork/neuron/commit/607558b))



# [0.19.0-beta.1](https://github.com/nervosnetwork/neuron/compare/v0.19.0-beta.0...v0.19.0-beta.1) (2019-09-04)


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.19.0-beta.1",
"version": "0.20.0-beta.0",
"npmClient": "yarn",
"useWorkspaces": true
}
18 changes: 9 additions & 9 deletions 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.19.0-beta.1",
"version": "0.20.0-beta.0",
"private": true,
"author": {
"name": "Nervos Core Dev",
Expand Down Expand Up @@ -43,23 +43,23 @@
}
},
"devDependencies": {
"@types/jest": "24.0.13",
"@types/jest": "24.0.18",
"@typescript-eslint/eslint-plugin": "2.1.0",
"@typescript-eslint/parser": "2.1.0",
"concurrently": "4.1.1",
"cross-env": "5.2.0",
"concurrently": "4.1.2",
"cross-env": "5.2.1",
"eslint": "6.3.0",
"eslint-config-airbnb": "18.0.1",
"eslint-config-prettier": "6.1.0",
"eslint-config-prettier": "6.2.0",
"eslint-plugin-import": "2.18.2",
"eslint-plugin-jsx-a11y": "6.2.3",
"eslint-plugin-prettier": "3.1.0",
"eslint-plugin-react": "7.14.3",
"husky": "3.0.1",
"lerna": "3.16.2",
"husky": "3.0.5",
"lerna": "3.16.4",
"ncp": "2.0.0",
"nodemon": "1.19.1",
"prettier": "1.17.1",
"nodemon": "1.19.2",
"prettier": "1.18.2",
"ts-jest": "24.0.2",
"typescript": "3.6.2",
"wait-on": "3.3.0"
Expand Down
7 changes: 6 additions & 1 deletion packages/neuron-ui/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ module.exports = {
"react/jsx-filename-extension": [1, {
"extensions": [".ts", ".tsx"]
}],
"react/jsx-props-no-spreading": [0]
"react/jsx-props-no-spreading": [0],
"typescript-eslint/no-angle-bracket-type-assertion": [0],
"no-alert": [0],
"no-console": [2, {
"allow": ["info", "warn", "error", "group", "groupEnd"]
}]
}
}
66 changes: 33 additions & 33 deletions packages/neuron-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "neuron-ui",
"version": "0.19.0-beta.1",
"version": "0.20.0-beta.0",
"private": true,
"author": {
"name": "Nervos Core Dev",
Expand Down Expand Up @@ -43,51 +43,51 @@
"last 2 chrome versions"
],
"dependencies": {
"@nervosnetwork/ckb-sdk-core": "0.19.1",
"@uifabric/experiments": "7.10.0",
"@uifabric/styling": "7.4.0",
"@nervosnetwork/ckb-sdk-core": "0.20.0",
"@uifabric/experiments": "7.16.1",
"@uifabric/styling": "7.6.2",
"canvg": "2.0.0",
"grommet-icons": "4.2.0",
"i18next": "15.1.3",
"office-ui-fabric-react": "7.19.1",
"grommet-icons": "4.3.0",
"i18next": "17.0.13",
"office-ui-fabric-react": "7.31.1",
"qr.js": "0.0.0",
"react": "16.8.6",
"react-dom": "16.8.6",
"react-i18next": "10.11.0",
"react-router-dom": "5.0.0",
"react": "16.9.0",
"react-dom": "16.9.0",
"react-i18next": "10.12.2",
"react-router-dom": "5.0.1",
"react-scripts": "3.1.1",
"styled-components": "5.0.0-beta.0"
},
"devDependencies": {
"@storybook/addon-actions": "5.1.9",
"@storybook/addon-knobs": "5.1.9",
"@storybook/addon-links": "5.1.9",
"@storybook/addon-storyshots": "5.1.10",
"@storybook/addon-viewport": "5.1.9",
"@storybook/addons": "5.1.9",
"@storybook/cli": "5.1.9",
"@storybook/react": "5.1.9",
"@types/enzyme": "3.9.3",
"@storybook/addon-actions": "5.1.11",
"@storybook/addon-knobs": "5.1.11",
"@storybook/addon-links": "5.1.11",
"@storybook/addon-storyshots": "5.1.11",
"@storybook/addon-viewport": "5.1.11",
"@storybook/addons": "5.1.11",
"@storybook/cli": "5.1.11",
"@storybook/react": "5.1.11",
"@types/enzyme": "3.10.3",
"@types/enzyme-adapter-react-16": "1.0.5",
"@types/node": "11.13.5",
"@types/react": "16.8.19",
"@types/react-dom": "16.8.4",
"@types/react-router-dom": "4.3.3",
"@types/node": "12.7.4",
"@types/react": "16.9.2",
"@types/react-dom": "16.9.0",
"@types/react-router-dom": "4.3.5",
"@types/storybook-react-router": "1.0.0",
"@types/storybook__addon-knobs": "5.0.3",
"@types/storybook__addon-storyshots": "5.1.0",
"@types/storybook__addon-storyshots": "5.1.1",
"@types/storybook__react": "4.0.2",
"@types/styled-components": "4.1.16",
"babel-jest": "24.8.0",
"enzyme": "3.9.0",
"enzyme-adapter-react-16": "1.13.2",
"@types/styled-components": "4.1.18",
"babel-jest": "24.9.0",
"enzyme": "3.10.0",
"enzyme-adapter-react-16": "1.14.0",
"jest-styled-components": "7.0.0-beta.1",
"jsqr": "1.2.0",
"lint-staged": "9.2.0",
"lint-staged": "9.2.5",
"node-sass": "4.12.0",
"react-app-rewired": "2.1.3",
"react-test-renderer": "16.8.6",
"rimraf": "2.6.3",
"storybook-react-router": "1.0.5"
"react-test-renderer": "16.9.0",
"rimraf": "3.0.0",
"storybook-react-router": "1.0.7"
}
}
8 changes: 5 additions & 3 deletions packages/neuron-ui/src/components/ErrorBoundary/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ const handleError = (error: Error) => {
}

class ErrorBoundary extends Component<{ children: React.ReactChild }, { hasError: boolean }> {
/* eslint-disable react/state-in-constructor */
state = {
hasError: false,
constructor(props: { children: React.ReactChild }) {
super(props)
this.state = {
hasError: false,
}
}

static getDerivedStateFromError(error: Error) {
Expand Down
2 changes: 1 addition & 1 deletion packages/neuron-ui/src/components/WalletSetting/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const WalletSetting = ({
hideMinerInfo()
addPopup('lock-arg-copied')(dispatch)
}
}, [minerInfo, t, hideMinerInfo, dispatch])
}, [minerInfo, hideMinerInfo, dispatch])

const onChange = useCallback(
(_e, option) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,9 @@ export const controllerMethodWrapper = (controllerName: string) => (
}
const res = await callControllerMethod(controller)(realParams)
if (process.env.NODE_ENV === 'development' && window.localStorage.getItem('log-response')) {
/* eslint-disable no-console */
console.group(`${controllerName} controller`)
console.info(JSON.stringify(res, null, 2))
console.groupEnd()
/* eslint-enable no-console */
}

if (!res) {
Expand Down
2 changes: 0 additions & 2 deletions packages/neuron-ui/src/services/remote/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ export * from './wallets'
export * from './networks'
export * from './transactions'

/* eslint-disable no-alert */

export const getLocale = () => {
if (!window.remote) {
console.warn('remote is not supported')
Expand Down
2 changes: 0 additions & 2 deletions packages/neuron-ui/src/states/stateProvider/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,9 @@ export const reducer = (
): State.AppWithNeuronWallet => {
const { app, wallet, settings, chain } = state
if (process.env.NODE_ENV === 'development' && window.localStorage.getItem('log-action')) {
/* eslint-disable no-console */
console.group(`type: ${type}`)
console.info(payload)
console.groupEnd()
/* eslint-enable no-console */
}
switch (type) {
// Actions of Neuron Wallet
Expand Down
1 change: 1 addition & 0 deletions packages/neuron-ui/src/theme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import {
import { registerIcons } from 'utils/icons'

loadTheme({
defaultFontStyle: { fontFamily: 'inherit' },
fonts: {
tiny: { fontSize: '11px' },
xSmall: { fontSize: '12px', lineHeight: '12px' },
Expand Down
3 changes: 0 additions & 3 deletions packages/neuron-ui/src/utils/formatters.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/* eslint-disable no-redeclare */
/* global BigInt */

import { CapacityUnit } from './const'

const base = 10e9
Expand Down
2 changes: 0 additions & 2 deletions packages/neuron-ui/src/utils/validators.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { MAX_NETWORK_NAME_LENGTH } from 'utils/const'
/* eslint-disable no-redeclare */
/* global BigInt */
import { ckbCore } from 'services/chain'
import { MIN_PASSWORD_LENGTH, MAX_PASSWORD_LENGTH, MIN_AMOUNT, MAX_DECIMAL_DIGITS, ErrorCode } from './const'

Expand Down
30 changes: 15 additions & 15 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.19.0-beta.1",
"version": "0.20.0-beta.0",
"private": true,
"author": {
"name": "Nervos Core Dev",
Expand Down Expand Up @@ -34,38 +34,38 @@
]
},
"dependencies": {
"@nervosnetwork/ckb-sdk-core": "0.19.1",
"@nervosnetwork/ckb-sdk-utils": "0.19.1",
"@nervosnetwork/ckb-sdk-core": "0.20.0",
"@nervosnetwork/ckb-sdk-utils": "0.20.0",
"bn.js": "4.11.8",
"chalk": "2.4.2",
"electron-log": "3.0.7",
"electron-updater": "4.1.2",
"electron-window-state": "5.0.3",
"elliptic": "6.4.1",
"i18next": "15.1.3",
"elliptic": "6.5.1",
"i18next": "17.0.13",
"reflect-metadata": "0.1.13",
"rxjs": "6.5.2",
"sha3": "2.0.4",
"rxjs": "6.5.3",
"sha3": "2.0.7",
"sqlite3": "4.1.0",
"typeorm": "0.2.18",
"uuid": "3.3.2"
"uuid": "3.3.3"
},
"devDependencies": {
"@nervosnetwork/ckb-types": "0.19.1",
"@nervosnetwork/ckb-types": "0.20.0",
"@types/electron-devtools-installer": "2.2.0",
"@types/elliptic": "6.4.8",
"@types/elliptic": "6.4.9",
"@types/sqlite3": "3.1.5",
"@types/uuid": "3.4.4",
"@types/uuid": "3.4.5",
"@types/webdriverio": "4.13.0",
"axios": "0.19.0",
"devtron": "1.4.0",
"electron": "6.0.0",
"electron": "6.0.7",
"electron-builder": "21.2.0",
"electron-devtools-installer": "2.2.4",
"electron-notarize": "0.1.1",
"lint-staged": "9.2.0",
"neuron-ui": "0.19.0-beta.1",
"rimraf": "2.6.3",
"lint-staged": "9.2.5",
"neuron-ui": "0.20.0-beta.0",
"rimraf": "3.0.0",
"spectron": "8.0.0",
"ts-transformer-imports": "0.4.3",
"ttypescript": "1.5.7"
Expand Down
9 changes: 5 additions & 4 deletions packages/neuron-wallet/src/models/lock-utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { scriptToHash } from '@nervosnetwork/ckb-sdk-utils'
import NodeService from 'services/node'
import { OutPoint, Script, ScriptHashType } from 'types/cell-types'
import env from 'env'
Expand Down Expand Up @@ -65,17 +66,17 @@ export default class LockUtils {
SystemScriptSubject.next({ codeHash: info.codeHash })
}

static computeScriptHash = async (script: Script): Promise<string> => {
static computeScriptHash = (script: Script): string => {
const ckbScript: CKBComponents.Script = ConvertTo.toSdkScript(script)
const hash: string = await (core.rpc as any).computeScriptHash(ckbScript)
const hash: string = scriptToHash(ckbScript)
if (!hash.startsWith('0x')) {
return `0x${hash}`
}
return hash
}

// use SDK lockScriptToHash
static lockScriptToHash = async (lock: Script) => {
static lockScriptToHash = (lock: Script) => {
return LockUtils.computeScriptHash(lock)
}

Expand All @@ -92,7 +93,7 @@ export default class LockUtils {

static async addressToLockHash(address: string, hashType: ScriptHashType = ScriptHashType.Type): Promise<string> {
const lock: Script = await this.addressToLockScript(address, hashType)
const lockHash: string = await this.lockScriptToHash(lock)
const lockHash: string = this.lockScriptToHash(lock)

return lockHash
}
Expand Down
2 changes: 1 addition & 1 deletion packages/neuron-wallet/src/services/cells.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default class CellsService {
}

const queryParams = {
lockHashes: In(lockHashes),
lockHash: In(lockHashes),
status: OutputStatus.Live,
}
const skipDataAndType = SkipDataAndType.getInstance().get()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,19 @@ export default class CheckOutput {

constructor(output: Cell) {
this.output = output
// this.calcLockHash()
this.calcLockHash()
}

public calcLockHash = async (): Promise<Cell> => {
public calcLockHash = (): Cell => {
if (this.output.lockHash) {
return this.output
}

this.output.lockHash = await LockUtils.lockScriptToHash(this.output.lock)
this.output.lockHash = LockUtils.lockScriptToHash(this.output.lock)
return this.output
}

public checkLockHash = async (lockHashList: string[]): Promise<boolean | undefined> => {
await this.calcLockHash()
return lockHashList.includes(this.output.lockHash!)
}
}
Loading