Skip to content

Commit

Permalink
refactor(joyid): avoid magick number
Browse files Browse the repository at this point in the history
  • Loading branch information
homura committed Apr 29, 2024
1 parent 16b32a7 commit a2ee43f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/joyid/src/script-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,12 @@ export function createJoyIDScriptInfo(
lock: "0x",
};

const BLAKE160_LENGTH = 20;
if (connection.keyType === "sub_key") {
//https://github.com/nervina-labs/ckb-dex-sdk/blob/b34c0b98e63ae1cfadcc9f9430a8d2a606f77a15/src/order/cancel.ts#L117C33-L117C41
const pubkeyHash = bytes
.bytify(utils.ckbHash("0x" + connection.pubkey))
.slice(0, 20);
.slice(0, BLAKE160_LENGTH);

const { unlock_entry: unlockEntry } =
await aggregator.generateSubkeyUnlockSmt({
Expand Down

1 comment on commit a2ee43f

@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.

🚀 New canary release: 0.22.2

npm install @ckb-lumos/[email protected]

Please sign in to comment.