Skip to content

Commit

Permalink
integrate ckb-js-toolkit into lumos
Browse files Browse the repository at this point in the history
  • Loading branch information
liubq7 committed Jan 17, 2022
1 parent 644ee2a commit aef1db2
Show file tree
Hide file tree
Showing 59 changed files with 61 additions and 2,766 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
build:
yarn workspace @ckb-lumos/bi build
yarn workspace @ckb-lumos/toolkit build
yarn workspace @ckb-lumos/config-manager build
yarn workspace @ckb-lumos/helpers build
yarn workspace @ckb-lumos/rpc build
Expand All @@ -8,13 +9,13 @@ build:
yarn workspace @ckb-lumos/hd-cache build
yarn workspace @ckb-lumos/ckb-indexer build
yarn workspace @ckb-lumos/lumos build
yarn workspace @ckb-lumos/core build

build-release: build
yarn workspace @ckb-lumos/lumos build:umd

test:
yarn workspace @ckb-lumos/bi test
yarn workspace @ckb-lumos/toolkit test
yarn workspace @ckb-lumos/base test
yarn workspace @ckb-lumos/common-scripts test
yarn workspace @ckb-lumos/config-manager test
Expand All @@ -24,7 +25,6 @@ test:
yarn workspace @ckb-lumos/indexer test
yarn workspace @ckb-lumos/transaction-manager test
yarn workspace @ckb-lumos/rpc test
yarn workspace @ckb-lumos/core test

test-coverage:
yarn c8 --reporter=cobertura --reporter=html --clean -o coverage make test
Expand Down
2 changes: 1 addition & 1 deletion packages/base/lib/denormalizers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { Reader } = require("ckb-js-toolkit");
const { Reader } = require("@ckb-lumos/toolkit");

function DenormalizeOutPoint(outPoint) {
return {
Expand Down
2 changes: 1 addition & 1 deletion packages/base/lib/indexer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { validators } = require("ckb-js-toolkit");
const { validators } = require("@ckb-lumos/toolkit");
const utils = require("./utils");

// Notice this TransactionCollector implementation only uses indexer
Expand Down
2 changes: 1 addition & 1 deletion packages/base/lib/utils.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Reader } from "ckb-js-toolkit";
import { Reader } from "@ckb-lumos/toolkit";
import { HexNumber } from "..";
import { Script, Input } from "./api";
import { Hash, HexString } from "./primitive";
Expand Down
2 changes: 1 addition & 1 deletion packages/base/lib/utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const blake2b = require("blake2b");
const { validators, normalizers, Reader } = require("ckb-js-toolkit");
const { validators, normalizers, Reader } = require("@ckb-lumos/toolkit");
const { SerializeScript, SerializeCellInput } = require("./core");
const { xxHash32 } = require("js-xxhash");

Expand Down
2 changes: 1 addition & 1 deletion packages/base/lib/values.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This module provides a ValueObject implementation for CKB related data
// structures to allow seamless immutable.js integration.
const { validators, normalizers, Reader } = require("ckb-js-toolkit");
const { validators, normalizers, Reader } = require("@ckb-lumos/toolkit");
const { xxHash32 } = require("js-xxhash");
const core = require("./core");
const { ckbHash } = require("./utils");
Expand Down
2 changes: 1 addition & 1 deletion packages/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"dependencies": {
"blake2b": "^2.1.3",
"ckb-js-toolkit": "^0.10.2",
"@ckb-lumos/toolkit": "^0.17.0-rc6",
"js-xxhash": "^1.0.4"
}
}
2 changes: 1 addition & 1 deletion packages/base/tests/denormalizers.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const test = require("ava");
const { normalizers } = require("ckb-js-toolkit");
const { normalizers } = require("@ckb-lumos/toolkit");

const core = require("../lib/core");
const denormalizers = require("../lib/denormalizers");
Expand Down
2 changes: 1 addition & 1 deletion packages/base/tests/utils.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const test = require("ava");
const { Reader } = require("ckb-js-toolkit");
const { Reader } = require("@ckb-lumos/toolkit");

const {
CKBHasher,
Expand Down
2 changes: 1 addition & 1 deletion packages/ckb-indexer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"dependencies": {
"@ckb-lumos/base": "^0.17.0-rc6",
"@ckb-lumos/rpc": "^0.17.0-rc6",
"ckb-js-toolkit": "^0.10.2",
"@ckb-lumos/toolkit": "^0.17.0-rc6",
"cross-fetch": "^3.1.4",
"events": "^3.3.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/ckb-indexer/src/collector.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { utils, Cell, BaseCellCollector } from "@ckb-lumos/base";
import { validators } from "ckb-js-toolkit";
import { validators } from "@ckb-lumos/toolkit";
import {
SearchKeyFilter,
CKBIndexerQueryOptions,
Expand Down
2 changes: 1 addition & 1 deletion packages/ckb-indexer/src/indexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
utils,
Block,
} from "@ckb-lumos/base";
import { validators } from "ckb-js-toolkit";
import { validators } from "@ckb-lumos/toolkit";
import { RPC } from "@ckb-lumos/rpc";
import { request, requestBatch } from "./services";
import { CKBCellCollector } from "./collector";
Expand Down
2 changes: 1 addition & 1 deletion packages/ckb-indexer/src/rpc.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RPC as ToolkitRPC } from "ckb-js-toolkit";
import { RPC as ToolkitRPC } from "@ckb-lumos/toolkit";
import { HexString, Tip } from "@ckb-lumos/base";
import {
GetCellsResults,
Expand Down
2 changes: 1 addition & 1 deletion packages/common-scripts/examples/pw_lock/lock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
createTransactionFromSkeleton,
} from "@ckb-lumos/helpers";
import { getConfig, Config, initializeConfig } from "@ckb-lumos/config-manager";
import { Reader, normalizers } from "ckb-js-toolkit";
import { Reader, normalizers } from "@ckb-lumos/toolkit";
import { Set } from "immutable";
import keccak, { Keccak } from "keccak";

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 @@ -28,7 +28,7 @@
"@ckb-lumos/config-manager": "^0.17.0-rc6",
"@ckb-lumos/helpers": "^0.17.0-rc6",
"@ckb-lumos/rpc": "^0.17.0-rc6",
"ckb-js-toolkit": "^0.10.2",
"@ckb-lumos/toolkit": "^0.17.0-rc6",
"immutable": "^4.0.0-rc.12"
},
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/common-scripts/src/anyone_can_pay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
parseAddress,
TransactionSkeletonType,
} from "@ckb-lumos/helpers";
import { normalizers, Reader } from "ckb-js-toolkit";
import { normalizers, Reader } from "@ckb-lumos/toolkit";
import { List, Set } from "immutable";
import { FromInfo, parseFromInfo } from "./from_info";
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/common-scripts/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import anyoneCanPay from "./anyone_can_pay";
const { ScriptValue } = values;
import { Set } from "immutable";
import { SerializeTransaction } from "@ckb-lumos/base/lib/core";
import { normalizers } from "ckb-js-toolkit";
import { normalizers } from "@ckb-lumos/toolkit";
import { isAcpScript } from "./helper";

function defaultLogger(level: string, message: string) {
Expand Down
2 changes: 1 addition & 1 deletion packages/common-scripts/src/dao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
import { getConfig, Config } from "@ckb-lumos/config-manager";
const { toBigUInt64LE, readBigUInt64LE } = utils;
const { parseSince } = sinceUtils;
import { normalizers, Reader } from "ckb-js-toolkit";
import { normalizers, Reader } from "@ckb-lumos/toolkit";
import secp256k1Blake160 from "./secp256k1_blake160";
import secp256k1Blake160Multisig from "./secp256k1_blake160_multisig";
import { FromInfo, parseFromInfo } from "./from_info";
Expand Down
2 changes: 1 addition & 1 deletion packages/common-scripts/src/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
createTransactionFromSkeleton,
parseAddress,
} from "@ckb-lumos/helpers";
import { Reader, normalizers } from "ckb-js-toolkit";
import { Reader, normalizers } from "@ckb-lumos/toolkit";
import { RPC } from "@ckb-lumos/rpc";
import { Set } from "immutable";
import { FromInfo, parseFromInfo, MultisigScript } from "./from_info";
Expand Down
2 changes: 1 addition & 1 deletion packages/common-scripts/src/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
HexString,
} from "@ckb-lumos/base";
const { CKBHasher, ckbHash } = utils;
import { normalizers, Reader } from "ckb-js-toolkit";
import { normalizers, Reader } from "@ckb-lumos/toolkit";
import { Config } from "@ckb-lumos/config-manager";

export function addCellDep(
Expand Down
2 changes: 1 addition & 1 deletion packages/common-scripts/src/locktime_pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
} from "@ckb-lumos/base";
const { toBigUInt64LE, readBigUInt64LE } = utils;
const { ScriptValue } = values;
import { normalizers, Reader } from "ckb-js-toolkit";
import { normalizers, Reader } from "@ckb-lumos/toolkit";
import {
generateDaoScript,
isSecp256k1Blake160MultisigScript,
Expand Down
2 changes: 1 addition & 1 deletion packages/common-scripts/src/secp256k1_blake160.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Set } from "immutable";
import { normalizers, Reader } from "ckb-js-toolkit";
import { normalizers, Reader } from "@ckb-lumos/toolkit";
import { parseAddress, minimalCellCapacity } from "@ckb-lumos/helpers";
import {
core,
Expand Down
2 changes: 1 addition & 1 deletion packages/common-scripts/src/secp256k1_blake160_multisig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
} from "@ckb-lumos/base";
import { getConfig, Config } from "@ckb-lumos/config-manager";
const { ScriptValue } = values;
import { normalizers, Reader } from "ckb-js-toolkit";
import { normalizers, Reader } from "@ckb-lumos/toolkit";
import { Set } from "immutable";
import {
addCellDep,
Expand Down
21 changes: 0 additions & 21 deletions packages/core/LICENSE

This file was deleted.

Loading

0 comments on commit aef1db2

Please sign in to comment.