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

[SDK] Improve ERC721 claimToBatch #5257

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kien-ngo
Copy link
Contributor

@kien-ngo kien-ngo commented Nov 1, 2024

Problem solved

Short description of the bug fixed or feature added


PR-Codex overview

This PR refactors the validation logic in the claimToBatch.ts file to improve error handling for missing recipient addresses and claim quantities. It replaces the use of findIndex with a for loop for more straightforward validation.

Detailed summary

  • Removed the use of findIndex for checking missing recipient addresses and claim quantities.
  • Added a for loop to iterate through options.content for validation.
  • Updated error messages to reflect the index of the item directly within the loop.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

vercel bot commented Nov 1, 2024

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

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 4:58am
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 4:58am
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 4:58am
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 4:58am

Copy link

changeset-bot bot commented Nov 1, 2024

⚠️ No Changeset found

Latest commit: fbf459b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

graphite-app bot commented Nov 1, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@kien-ngo kien-ngo marked this pull request as ready for review November 1, 2024 04:47
Copy link
Contributor Author

kien-ngo commented Nov 1, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @kien-ngo and the rest of your teammates on Graphite Graphite

Copy link
Contributor

github-actions bot commented Nov 1, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 43 KB (0%) 861 ms (0%) 2.5 s (-7.81% 🔽) 3.3 s
thirdweb (cjs) 102.91 KB (0%) 2.1 s (0%) 7.2 s (-0.89% 🔽) 9.2 s
thirdweb (minimal + tree-shaking) 4.84 KB (0%) 97 ms (0%) 223 ms (+12.61% 🔺) 320 ms
thirdweb/chains (tree-shaking) 498 B (0%) 10 ms (0%) 114 ms (+127.4% 🔺) 124 ms
thirdweb/react (minimal + tree-shaking) 16.98 KB (0%) 340 ms (0%) 395 ms (-30.64% 🔽) 735 ms

Copy link

codecov bot commented Nov 1, 2024

Codecov Report

Attention: Patch coverage is 20.00000% with 8 lines in your changes missing coverage. Please review.

Project coverage is 45.36%. Comparing base (f40d247) to head (fbf459b).

Files with missing lines Patch % Lines
.../src/extensions/erc721/drops/write/claimToBatch.ts 20.00% 8 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5257   +/-   ##
=======================================
  Coverage   45.36%   45.36%           
=======================================
  Files        1067     1067           
  Lines       55434    55433    -1     
  Branches     3991     3991           
=======================================
+ Hits        25147    25148    +1     
+ Misses      29596    29594    -2     
  Partials      691      691           
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from f40d247
packages 40.40% <20.00%> (+<0.01%) ⬆️

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
.../src/extensions/erc721/drops/write/claimToBatch.ts 88.05% <20.00%> (+2.76%) ⬆️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants