Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support joyid #659

Merged
merged 20 commits into from
May 6, 2024
Merged

feat: support joyid #659

merged 20 commits into from
May 6, 2024

Conversation

homura
Copy link
Collaborator

@homura homura commented Mar 28, 2024

Description

Resolve #640

This PR introduces a new package @ckb-lumos/joyid for singing, and collecting cells with the JoyID lock. However, due to some limitations of the JoyID lock, a transaction can only contains a JoyID lock, which means you CAN'T mix locks, such as the secp256k1-blake160 lock, in a transaction, even with another JoyID lock that has a different lock.args

import { createJoyIDScriptInfo, getDefualtConfig } from "@ckb-lumos/joyid";
import { registerCustomLockScriptInfos } from "@ckb-lumos/lumos/common-scripts/common";
import { connect } from "@joyid/ckb";

// step 1. connect to JoyID
const connection = await connect();

// step 2. create JoyID script info, we can use the helper function getDefaultConfig to generate a default config
const joyIDScriptInfo = createJoyIDScriptInfo(
  connection,
  getDefaultConfig(false /* isMainnet */)
);

// step 3. register JoyID script info into Lumos
registerCustomLockScriptInfos(joyIDScriptInfo);

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • Unit test
  • Integration test with ckb-debugger
  • Mannually test with an example

Copy link

vercel bot commented Mar 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
lumos-website ✅ Ready (Inspect) Visit Preview Apr 29, 2024 5:19pm

Copy link

codecov bot commented Mar 28, 2024

Codecov Report

Attention: Patch coverage is 96.31579% with 14 lines in your changes are missing coverage. Please review.

Project coverage is 87.36%. Comparing base (a1592dd) to head (0855d00).
Report is 11 commits behind head on develop.

❗ Current head 0855d00 differs from pull request most recent head bd2447b. Consider uploading reports for the commit bd2447b to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #659      +/-   ##
===========================================
+ Coverage    84.30%   87.36%   +3.06%     
===========================================
  Files          121      124       +3     
  Lines        24574    24954     +380     
  Branches      2364     2570     +206     
===========================================
+ Hits         20717    21801    +1084     
+ Misses        3816     3105     -711     
- Partials        41       48       +7     
Files Coverage Δ
packages/joyid/src/index.ts 100.00% <100.00%> (ø)
packages/joyid/src/constants.ts 98.78% <98.78%> (ø)
packages/joyid/src/script-info.ts 95.62% <95.62%> (ø)

... and 14 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ff0b583...bd2447b. Read the comment docs.

@homura homura marked this pull request as ready for review April 7, 2024 14:33
@homura homura changed the title [HOLD ON] feat: support joyid feat: support joyid Apr 7, 2024
@homura homura requested a review from Keith-CY April 10, 2024 14:07
@Keith-CY
Copy link
Member

CI failed

@Keith-CY Keith-CY closed this Apr 29, 2024
@Keith-CY Keith-CY reopened this Apr 29, 2024
@homura
Copy link
Collaborator Author

homura commented Apr 29, 2024

CI failed

the new ESLint rule ban-magick-number banned this PR. I've fixed it

examples/joyid/package.json Outdated Show resolved Hide resolved
@homura homura merged commit aef7250 into develop May 6, 2024
8 checks passed
@homura homura deleted the experimental-joyid branch May 6, 2024 03:41
@github-actions github-actions bot mentioned this pull request May 6, 2024
@github-actions github-actions bot mentioned this pull request Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support JoyID
2 participants