Skip to content

Commit

Permalink
refactor: remove peerDependency of toolkit
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyouxin committed Oct 8, 2023
1 parent b6f6a00 commit f30ac85
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
10 changes: 4 additions & 6 deletions packages/toolkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,14 @@
},
"author": "Xuejie Xiao",
"license": "MIT",
"peerDependencies": {
"cross-fetch": "^3.1.4",
"jsbi": "^4.1.0"
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"@ckb-lumos/bi": "0.21.0-next.0"
},
"devDependencies": {
"@babel/plugin-proposal-export-namespace-from": "^7.18.9",
"@babel/plugin-transform-modules-commonjs": "^7.21.5",
"jsbi": "^4.1.0"
"@babel/plugin-transform-modules-commonjs": "^7.21.5"
}
}
4 changes: 2 additions & 2 deletions packages/toolkit/src/normalizers.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
// Note this is only used when you need to deal with CKB structures in molecule
// format. If you are using RPCs or GraphQL to interact with CKB, chances are you
// will not need this package.
import JSBI from "jsbi";
import { BI } from "@ckb-lumos/bi";
import { Reader } from "./reader";
/**
* @deprecated please follow the {@link https://lumos-website.vercel.app/migrations/migrate-to-v0.19 migration-guide}
*/
function normalizeHexNumber(length) {
return function (debugPath, value) {
if (!(value instanceof ArrayBuffer)) {
let intValue = JSBI.BigInt(value).toString(16);
let intValue = BI.from(value).toHexString();
if (intValue.length % 2 !== 0) {
intValue = "0" + intValue;
}
Expand Down
10 changes: 10 additions & 0 deletions packages/toolkit/tests/normailizers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const test = require("ava");
const { normalizers } = require("../lib");

test("correct outPoint should pass validation", (t) => {
normalizers.NormalizeOutPoint({
txHash: `0x${'00'.repeat(32)}`,
index: '0x1',
});
t.pass();
});
11 changes: 4 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f30ac85

Please sign in to comment.