Skip to content

Commit

Permalink
Merge pull request #1060 from nervosnetwork/rc/v0.24.2
Browse files Browse the repository at this point in the history
[ᚬmaster] Release v0.24.2
  • Loading branch information
ashchan authored Nov 8, 2019
2 parents 86b66a2 + 258ebbe commit 57b1a03
Show file tree
Hide file tree
Showing 24 changed files with 130 additions and 216 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
## [0.24.2](https://github.com/nervosnetwork/neuron/compare/v0.24.1...v0.24.2) (2019-11-08)


### Bug Fixes

* replace with empty string in input group rename witness ([5d59f3d](https://github.com/nervosnetwork/neuron/commit/5d59f3d))
* skip get previous tx when cellbase ([41600ea](https://github.com/nervosnetwork/neuron/commit/41600ea))
* skip get previous tx when cellbase in indexer ([7e8a578](https://github.com/nervosnetwork/neuron/commit/7e8a578))
* skip the cellbase tx, not the first input ([aeeb464](https://github.com/nervosnetwork/neuron/commit/aeeb464))


### Features

* Disable search history by amount ([9bdece6](https://github.com/nervosnetwork/neuron/commit/9bdece6))
* remove skip data and type toggle ([879d227](https://github.com/nervosnetwork/neuron/commit/879d227))



## [0.24.1](https://github.com/nervosnetwork/neuron/compare/v0.24.0...v0.24.1) (2019-11-07)


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.24.1",
"version": "0.24.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.24.1",
"version": "0.24.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.24.1",
"version": "0.24.2",
"private": true,
"author": {
"name": "Nervos Core Dev",
Expand Down
32 changes: 4 additions & 28 deletions packages/neuron-ui/src/components/GeneralSetting/index.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,8 @@
import React, { useMemo } from 'react'
import { Stack, Toggle } from 'office-ui-fabric-react'
import { useTranslation } from 'react-i18next'
import React from 'react'
import { Stack } from 'office-ui-fabric-react'

import { StateWithDispatch } from 'states/stateProvider/reducer'
import { setSkipDataAndType } from 'states/stateProvider/actionCreators'

const GeneralSetting = ({
settings: {
general: { skipDataAndType },
},
dispatch,
}: React.PropsWithoutRef<StateWithDispatch>) => {
const [t] = useTranslation()
const [onSetSkipDataAndType] = useMemo(() => [() => setSkipDataAndType(!skipDataAndType)(dispatch)], [
dispatch,
skipDataAndType,
])
return (
<Stack tokens={{ childrenGap: 15 }}>
<Toggle
checked={skipDataAndType}
label={t('settings.general.skip-data-and-type')}
onText={t('common.toggle.on')}
offText={t('common.toggle.off')}
onChange={onSetSkipDataAndType}
/>
</Stack>
)
const GeneralSetting = () => {
return <Stack tokens={{ childrenGap: 15 }} />
}

GeneralSetting.displayName = 'GeneralSetting'
Expand Down
1 change: 0 additions & 1 deletion packages/neuron-ui/src/services/remote/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ export * from './app'
export * from './wallets'
export * from './networks'
export * from './transactions'
export * from './skipDataAndType'

const REMOTE_MODULE_NOT_FOUND =
'The remote module is not found, please make sure the UI is running inside the Electron App'
Expand Down
7 changes: 0 additions & 7 deletions packages/neuron-ui/src/services/remote/skipDataAndType.ts

This file was deleted.

4 changes: 1 addition & 3 deletions packages/neuron-ui/src/states/initStates/settings.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { wallets, networks } from 'services/localCache'

export const settingsState: State.Settings = {
general: {
skipDataAndType: false,
},
general: {},
networks: networks.load(),
wallets: wallets.load(),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export const initAppState = () => (dispatch: StateDispatch, history: any) => {
syncedBlockNumber = '',
connectionStatus = false,
codeHash = '',
skipDataAndType = false,
} = res.result
dispatch({
type: NeuronWalletActions.InitAppState,
Expand All @@ -39,7 +38,6 @@ export const initAppState = () => (dispatch: StateDispatch, history: any) => {
syncedBlockNumber,
connectionStatus,
codeHash,
skipDataAndType,
},
})
if (!wallet) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,16 @@ import app from './app'
import wallets from './wallets'
import transactions from './transactions'
import settings from './settings'
import skipDataAndType from './skipDataAndType'

export * from './app'
export * from './wallets'
export * from './transactions'
export * from './settings'
export * from './skipDataAndType'
export const actionCreators = {
...app,
...wallets,
...transactions,
...settings,
...skipDataAndType,
}

export default actionCreators

This file was deleted.

16 changes: 0 additions & 16 deletions packages/neuron-ui/src/states/stateProvider/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ export enum NeuronWalletActions {
// Connection
UpdateConnectionStatus = 'updateConnectionStatus',
UpdateSyncedBlockNumber = 'updateSyncedBlockNumber',
// settings
UpdateSkipDataAndType = 'updateSkipDataAndType',
}
export enum AppActions {
UpdateTransactionID = 'updateTransactionID',
Expand Down Expand Up @@ -79,7 +77,6 @@ export const reducer = (
syncedBlockNumber,
connectionStatus,
codeHash,
skipDataAndType,
} = payload
return {
...state,
Expand All @@ -95,25 +92,12 @@ export const reducer = (
settings: {
general: {
...state.settings.general,
skipDataAndType,
},
networks,
wallets,
},
}
}
case NeuronWalletActions.UpdateSkipDataAndType: {
return {
...state,
settings: {
...settings,
general: {
...settings.general,
skipDataAndType: payload,
},
},
}
}
case NeuronWalletActions.UpdateCodeHash: {
return {
...state,
Expand Down
9 changes: 1 addition & 8 deletions packages/neuron-ui/src/stories/GeneralSetting.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,9 @@ import React from 'react'
import { storiesOf } from '@storybook/react'
import { withKnobs } from '@storybook/addon-knobs'
import GeneralSetting from 'components/GeneralSetting'
import initStates from 'states/initStates'

const stories = storiesOf('GeneralSettings', module)

stories.addDecorator(withKnobs).add('With knobs', () => {
const props = {
...initStates,
settings: {
...initStates.settings,
},
}
return <GeneralSetting {...props} dispatch={() => {}} />
return <GeneralSetting />
})
4 changes: 1 addition & 3 deletions packages/neuron-ui/src/types/App/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,7 @@ declare namespace State {
}
}
interface Settings {
general: {
skipDataAndType: boolean
}
general: {}
networks: Network[]
wallets: WalletIdentity[]
}
Expand Down
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.24.1",
"version": "0.24.2",
"private": true,
"author": {
"name": "Nervos Core Dev",
Expand Down Expand Up @@ -64,7 +64,7 @@
"electron-devtools-installer": "2.2.4",
"electron-notarize": "0.1.1",
"lint-staged": "9.2.5",
"neuron-ui": "0.24.1",
"neuron-ui": "0.24.2",
"rimraf": "3.0.0",
"spectron": "8.0.0",
"ts-transformer-imports": "0.4.3",
Expand Down
19 changes: 1 addition & 18 deletions packages/neuron-wallet/src/controllers/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,10 @@ import env from 'env'
import i18n from 'utils/i18n'
import { popContextMenu } from './app/menu'
import { showWindow } from './app/show-window'
import {
TransactionsController,
WalletsController,
SyncInfoController,
SkipDataAndTypeController,
NetworksController
} from 'controllers'
import { TransactionsController, WalletsController, SyncInfoController, NetworksController } from 'controllers'
import { NetworkType, NetworkID, Network } from 'types/network'
import NetworksService from 'services/networks'
import WalletsService from 'services/wallets'
import SkipDataAndType from 'services/settings/skip-data-and-type'
import { ConnectionStatusSubject } from 'models/subjects/node'
import { SystemScriptSubject } from 'models/subjects/system-script'
import { MapApiResponse } from 'decorators'
Expand Down Expand Up @@ -82,8 +75,6 @@ export default class ApiController {
}).then(res => res.result)
: []

const skipDataAndType = SkipDataAndType.getInstance().get()

const initState = {
currentWallet,
wallets: [...wallets.map(({ name, id }) => ({ id, name }))],
Expand All @@ -94,7 +85,6 @@ export default class ApiController {
syncedBlockNumber,
connectionStatus,
codeHash,
skipDataAndType,
}

return { status: ResponseCode.Success, result: initState }
Expand Down Expand Up @@ -265,11 +255,4 @@ export default class ApiController {
public static async showTransactionDetails(hash: string) {
showWindow(`${env.mainURL}#/transaction/${hash}`, i18n.t(`messageBox.transaction.title`, { hash }))
}

// Misc

@MapApiResponse
public static async updateSkipDataAndType(skip: boolean) {
return SkipDataAndTypeController.update(skip)
}
}
4 changes: 1 addition & 3 deletions packages/neuron-wallet/src/controllers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import NetworksController from './networks'
import WalletsController from './wallets'
import TransactionsController from './transactions'
import SyncInfoController from './sync-info'
import SkipDataAndTypeController from './skip-data-and-type'
import UpdateController from './update'

import ApiController from './api'
Expand All @@ -14,7 +13,6 @@ export {
WalletsController,
TransactionsController,
SyncInfoController,
SkipDataAndTypeController,
UpdateController,
ApiController
ApiController,
}
22 changes: 0 additions & 22 deletions packages/neuron-wallet/src/controllers/skip-data-and-type.ts

This file was deleted.

5 changes: 5 additions & 0 deletions packages/neuron-wallet/src/services/indexer/queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ export default class IndexerQueue {

private url: string

private emptyTxHash = '0x' + '0'.repeat(64)

constructor(url: string, lockHashInfos: LockHashInfo[], tipNumberSubject: Subject<string | undefined>) {
this.lockHashInfos = lockHashInfos
this.url = url
Expand Down Expand Up @@ -213,6 +215,9 @@ export default class IndexerQueue {
if (!txEntity || !txEntity.blockHash) {
if (!txEntity) {
for (const input of transaction.inputs!) {
if (input.previousOutput!.txHash === this.emptyTxHash) {
continue
}
const previousTxWithStatus = await this.getBlocksService.getTransaction(input.previousOutput!.txHash)
const previousTx = TypeConvert.toTransaction(previousTxWithStatus.transaction)
const previousOutput = previousTx.outputs![+input.previousOutput!.index]
Expand Down
Loading

0 comments on commit 57b1a03

Please sign in to comment.