Skip to content

Commit

Permalink
fix conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
liubq7 committed Jan 18, 2022
2 parents 039a588 + 684e906 commit a3e316d
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

make lint
yarn run lint
35 changes: 0 additions & 35 deletions Makefile

This file was deleted.

39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,42 @@ As of now, lumos contains the following components:
* [hd](./packages/hd): an HD wallet manager for CKB. It support mnemonic and keystore, compatible with `Neuron` and `ckb-cli`, you can load keystore from `Neuron` or `ckb-cli` directly and import mnemonic generated by `Neuron`.
* [hd-cache](./packages/hd-cache): an HD cache manager for CKB. It build a memory cache for derived addresses and live cells of these addresses.
* [rpc](./packages/rpc): RPC module for CKB RPC. Provide type definations for CKB RPC interface.

## Building

### Requirements
- [Node.js](https://nodejs.org)
- [Yarn](https://yarnpkg.com/)
- [node-gyp](https://github.com/nodejs/node-gyp)

```bash
sudo apt-get update
sudo apt install nodejs
npm install --global yarn
sudo apt install build-essential
```

### Build
```bash
yarn run build
```

### Test (ava)
```bash
yarn run test
```

### Test Coverage (c8)
```bash
yarn run test-coverage
```

### Format & Lint
```bash
yarn run lint
```

### Clean
```bash
yarn run clean
```
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,18 @@
"scripts": {
"docs": "typedoc .",
"prepare": "husky install",
"test": "lerna run test",
"test": "lerna run test --parallel --ignore \"**/*/*indexer*\"",
"test-coverage": "yarn c8 --reporter=cobertura --reporter=html --clean -o coverage yarn run test",
"build:types": "lerna run build:types",
"build:js": "lerna run build:js --parallel",
"build": "run-p build:*",
"build-release": "lerna run --scope @ckb-lumos/lumos build:umd",
"lint": "lerna run fmt && lerna run lint && git diff --exit-code",
"clean": "lerna run clean"
},
"husky": {
"hooks": {
"pre-push": "make lint"
"pre-push": "yarn run lint"
}
}
}
2 changes: 1 addition & 1 deletion packages/bi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"scripts": {
"fmt": "prettier --write \"{src,tests,examples}/**/*.ts\" package.json",
"lint": "eslint -c ../../.eslintrc.js \"{src,tests,examples}/**/*.ts\"",
"test": "ava **/*.test.ts",
"test": "ava **/*.test.ts --timeout=2m",
"build": "npm run build:types && npm run build:js",
"build:types": "tsc --declaration --emitDeclarationOnly",
"build:js": "babel --root-mode upward src --out-dir lib --extensions .ts -s",
Expand Down
32 changes: 17 additions & 15 deletions packages/ckb-indexer/src/transaction_collector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,22 +118,24 @@ export class CKBIndexerTransactionCollector extends BaseIndexerModule.Transactio
});
}
});
await services
.requestBatch(this.CKBRpcUrl, txIoTypeInputOutPointList)
.then((response: GetTransactionRPCResult[]) => {
response.forEach((item: GetTransactionRPCResult) => {
const itemId = item.id.toString();
const [cellIndex, transactionHash] = itemId.split("-");
const output: Output =
item.result.transaction.outputs[parseInt(cellIndex)];
const targetTx = transactionList.find(
(tx) => tx.transaction.hash === transactionHash
);
if (targetTx) {
targetTx.inputCell = output;
}
if (txIoTypeInputOutPointList.length > 0) {
await services
.requestBatch(this.CKBRpcUrl, txIoTypeInputOutPointList)
.then((response: GetTransactionRPCResult[]) => {
response.forEach((item: GetTransactionRPCResult) => {
const itemId = item.id.toString();
const [cellIndex, transactionHash] = itemId.split("-");
const output: Output =
item.result.transaction.outputs[parseInt(cellIndex)];
const targetTx = transactionList.find(
(tx) => tx.transaction.hash === transactionHash
);
if (targetTx) {
targetTx.inputCell = output;
}
});
});
});
}

//filter by ScriptWrapper.argsLen
transactionList = transactionList.filter(
Expand Down
2 changes: 1 addition & 1 deletion packages/common-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"scripts": {
"fmt": "prettier --write \"{src,tests,examples}/**/*.ts\" package.json",
"lint": "eslint -c ../../.eslintrc.js \"{src,tests,examples}/**/*.ts\"",
"test": "ava **/*.test.ts",
"test": "ava **/*.test.ts --timeout=2m",
"build": "npm run build:types && npm run build:js",
"build:types": "tsc --declaration --emitDeclarationOnly",
"build:js": "babel --root-mode upward src --out-dir lib --extensions .ts -s",
Expand Down
2 changes: 1 addition & 1 deletion packages/helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"scripts": {
"fmt": "prettier --write \"{src,tests}/**/*.ts\" package.json",
"lint": "eslint -c ../../.eslintrc.js \"{src,tests}/**/*.ts\"",
"test": "ava tests/**/*.test.ts",
"test": "ava tests/**/*.test.ts --timeout=2m",
"build": "npm run build:types && npm run build:js",
"build:types": "tsc --declaration --emitDeclarationOnly",
"build:js": "babel --root-mode upward src --out-dir lib --extensions .ts -s",
Expand Down

0 comments on commit a3e316d

Please sign in to comment.