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

fix(common-scripts): sudt data may over 16 bytes #549

Merged
merged 6 commits into from
Aug 7, 2023
Merged

Conversation

homura
Copy link
Collaborator

@homura homura commented Aug 4, 2023

Description

Fixes #548

the data of an sUDT cell may be over 16 bytes but it is still valid, so we should slice the first 16 bytes as the sUDT amount

Type of change

  • Bug fix (non-breaking change which fixes an issue)

@vercel
Copy link

vercel bot commented Aug 4, 2023

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

Name Status Preview Updated (UTC)
lumos-website ✅ Ready (Inspect) Visit Preview Aug 4, 2023 11:11am

@ShookLyngs
Copy link

ShookLyngs commented Aug 4, 2023

Not an issue, just out of curious: does the changesets need a strong format?

For example, I see the lumos' changeset messages are like this: "doing something".
What happens if it is like this: "Doing something"?
Or like this: "fix: doing something"?

I'm also using changesets, wonder if it matters.

@codecov
Copy link

codecov bot commented Aug 4, 2023

Codecov Report

Merging #549 (16096ad) into develop (6bb442c) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #549   +/-   ##
========================================
  Coverage    86.35%   86.35%           
========================================
  Files          114      114           
  Lines        22917    22928   +11     
  Branches      2310     2312    +2     
========================================
+ Hits         19790    19800   +10     
- Misses        3084     3086    +2     
+ Partials        43       42    -1     
Files Changed Coverage Δ
packages/common-scripts/src/anyone_can_pay.ts 66.47% <100.00%> (-0.05%) ⬇️
packages/common-scripts/src/sudt.ts 95.10% <100.00%> (+0.06%) ⬆️

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 6bb442c...16096ad. Read the comment docs.

@homura
Copy link
Collaborator Author

homura commented Aug 4, 2023

Not an issue, just out of curious: does the changesets need a strong format?

For example, I see the lumos' changeset messages are like this: "doing something". What happens if it is like this: "Doing something"? Or like this: "fix: doing something"?

I'm also using changesets, wonder if it matters.

No, the changesets has no restrictions on the format, here is an example

"@ckb-lumos/common-scripts": patch
---

enable ACP to work with cells with more than 16 bytes of data
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enable ACP to work with sUDT cells with more than 16 bytes of data

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@zhangyouxin
Copy link
Contributor

better add test case in packages/common-scripts/tests/sudt.test.ts though it's a small change

Signed-off-by: Yonghui Lin <homura.dev@gmail.com>
@zhangyouxin
Copy link
Contributor

Do we need to update the example: examples/exchange-sudt-for-ckb/src/lib.ts

@homura homura merged commit 5d1862f into develop Aug 7, 2023
@homura homura deleted the sudt-16bytes branch August 7, 2023 02:47
@github-actions github-actions bot mentioned this pull request Aug 7, 2023
@github-actions github-actions bot mentioned this pull request Nov 28, 2023
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.

Predefined LockScriptInfos cannot be replaced
3 participants