Skip to content

Commit

Permalink
Merge branch 'develop' into alpha/skip-unidentified-inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith-CY committed Dec 15, 2023
2 parents 066845e + a156dca commit 56096fe
Show file tree
Hide file tree
Showing 10 changed files with 1,102 additions and 680 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"update:client-versions": "node ./scripts/update-ckb-client-versions.js"
},
"devDependencies": {
"@babel/core": "7.23.3",
"@babel/core": "7.23.5",
"@types/jest": "27.5.2",
"@types/node": "18.16.18",
"@types/npmlog": "4.1.6",
Expand All @@ -53,12 +53,12 @@
"eslint-config-prettier": "8.10.0",
"eslint-plugin-prettier": "4.2.1",
"husky": "8.0.3",
"lerna": "7.1.0",
"lerna": "7.4.2",
"lint-staged": "13.3.0",
"ncp": "2.0.0",
"prettier": "2.8.8",
"ts-jest": "27.1.5",
"typescript": "5.3.2",
"ts-jest": "29.1.1",
"typescript": "5.3.3",
"wait-on": "7.0.1"
},
"dependencies": {},
Expand Down
10 changes: 5 additions & 5 deletions packages/neuron-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
"last 2 chrome versions"
],
"dependencies": {
"@ckb-lumos/base": "0.21.0-next.2",
"@ckb-lumos/codec": "0.21.0-next.2",
"@ckb-lumos/base": "0.21.1",
"@ckb-lumos/codec": "0.21.1",
"@nervosnetwork/ckb-sdk-core": "0.109.0",
"@nervosnetwork/ckb-sdk-utils": "0.109.0",
"canvg": "2.0.0",
Expand Down Expand Up @@ -80,7 +80,7 @@
"@storybook/react": "7.0.24",
"@storybook/react-webpack5": "7.0.24",
"@storybook/testing-library": "0.2.2",
"@types/enzyme": "3.10.16",
"@types/enzyme": "3.10.18",
"@types/enzyme-adapter-react-16": "1.0.9",
"@types/node": "18.16.18",
"@types/react": "17.0.71",
Expand All @@ -93,10 +93,10 @@
"enzyme": "3.11.0",
"enzyme-adapter-react-16": "1.15.7",
"eslint-config-airbnb": "19.0.4",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-import": "2.29.0",
"eslint-plugin-jsx-a11y": "6.7.1",
"eslint-plugin-react": "7.32.2",
"jest-styled-components": "7.1.1",
"jest-styled-components": "7.2.0",
"react-app-rewired": "2.2.1",
"react-scripts": "5.0.1",
"react-test-renderer": "16.14.0",
Expand Down
24 changes: 12 additions & 12 deletions packages/neuron-wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@
]
},
"dependencies": {
"@ckb-lumos/base": "0.21.0-next.2",
"@ckb-lumos/bi": "0.21.0-next.2",
"@ckb-lumos/ckb-indexer": "0.21.0-next.2",
"@ckb-lumos/codec": "0.21.0-next.2",
"@ckb-lumos/common-scripts": "0.21.0-next.2",
"@ckb-lumos/config-manager": "0.21.0-next.2",
"@ckb-lumos/hd": "0.21.0-next.2",
"@ckb-lumos/helpers": "0.21.0-next.2",
"@ckb-lumos/rpc": "0.21.0-next.2",
"@ckb-lumos/base": "0.21.1",
"@ckb-lumos/bi": "0.21.1",
"@ckb-lumos/ckb-indexer": "0.21.1",
"@ckb-lumos/codec": "0.21.1",
"@ckb-lumos/common-scripts": "0.21.1",
"@ckb-lumos/config-manager": "0.21.1",
"@ckb-lumos/hd": "0.21.1",
"@ckb-lumos/helpers": "0.21.1",
"@ckb-lumos/rpc": "0.21.1",
"@iarna/toml": "2.2.5",
"@ledgerhq/hw-transport-node-hid": "6.27.22",
"@spore-sdk/core": "0.1.0-beta.9",
Expand Down Expand Up @@ -84,7 +84,7 @@
"@types/electron-devtools-installer": "2.2.5",
"@types/elliptic": "6.4.18",
"@types/iarna__toml": "2.0.5",
"@types/jest-when": "3.5.2",
"@types/jest-when": "3.5.5",
"@types/ledgerhq__hw-transport": "4.21.8",
"@types/ledgerhq__hw-transport-node-hid": "4.22.5",
"@types/leveldown": "4.0.6",
Expand All @@ -96,8 +96,8 @@
"electron-build-env": "0.2.0",
"electron-builder": "23.6.0",
"electron-devtools-installer": "3.2.0",
"jest-when": "3.5.2",
"jest-when": "3.6.0",
"neuron-ui": "0.112.0",
"typescript": "5.3.2"
"typescript": "5.3.3"
}
}
27 changes: 1 addition & 26 deletions packages/neuron-wallet/src/services/sdk-core.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,7 @@
import { CKBRPC } from '@ckb-lumos/rpc'
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): CKBRPC => {
const rpc = new CKBRPC(url)
if (url.startsWith('https')) {
rpc.setNode({ url, httpsAgent: getHttpsAgent() })
} else {
rpc.setNode({ url, httpAgent: getHttpAgent() })
}
return rpc
return new CKBRPC(url, { fetch: (request, init) => globalThis.fetch(request, { ...init, keepalive: true }) })
}

export default {
Expand Down
4 changes: 3 additions & 1 deletion packages/neuron-wallet/src/services/transaction-sender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,9 @@ export default class TransactionSender {
const rpc = generateRPC(currentNetwork.remote, currentNetwork.type)

let tx = await rpc.getTransaction(depositOutPoint.txHash)
if (tx.txStatus.status !== 'committed') throw new Error('Transaction is not committed yet')
if (tx.txStatus.status !== 'committed' || !tx.txStatus.blockHash) {
throw new Error('Transaction is not committed yet')
}
const depositBlockHash = tx.txStatus.blockHash

const cellOutput = tx.transaction.outputs[+depositOutPoint.index]
Expand Down
Loading

1 comment on commit 56096fe

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Packaging for test is done in 7218674624

Please # to comment.