Skip to content

Conversation

@kien-ngo
Copy link
Contributor

@kien-ngo kien-ngo commented Oct 22, 2024

Problem solved

Short description of the bug fixed or feature added


PR-Codex overview

This PR introduces the claimToBatch functionality for the ERC721 extension, allowing multiple claims in a single transaction and optimizing claim content. It includes tests for the new feature and ensures that the claiming process works as intended.

Detailed summary

  • Added claimToBatch function in claimToBatch.ts for batching claims.
  • Created ClaimToBatchParams type for input parameters.
  • Implemented optimizeClaimContent to consolidate identical recipient claims.
  • Added tests for claimToBatch and optimizeClaimContent in claimToBatch.test.ts.
  • Verified functionality through unit tests ensuring correct ownership assignment after batch claims.

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

@vercel
Copy link

vercel bot commented Oct 22, 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 Oct 23, 2024 3:42am
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 23, 2024 3:42am
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 23, 2024 3:42am
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 23, 2024 3:42am

@changeset-bot
Copy link

changeset-bot bot commented Oct 22, 2024

⚠️ No Changeset found

Latest commit: c32576f

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

@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 22, 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 October 22, 2024 10:32
Copy link
Contributor Author

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

@github-actions
Copy link
Contributor

github-actions bot commented Oct 22, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 42.81 KB (0%) 857 ms (0%) 421 ms (-6.97% 🔽) 1.3 s
thirdweb (cjs) 102.66 KB (0%) 2.1 s (0%) 1.3 s (+47.64% 🔺) 3.4 s
thirdweb (minimal + tree-shaking) 4.84 KB (0%) 97 ms (0%) 141 ms (+460.38% 🔺) 238 ms
thirdweb/chains (tree-shaking) 498 B (0%) 10 ms (0%) 104 ms (+102.41% 🔺) 114 ms
thirdweb/react (minimal + tree-shaking) 17.33 KB (0%) 347 ms (0%) 256 ms (+271.59% 🔺) 603 ms

@codecov
Copy link

codecov bot commented Oct 22, 2024

Codecov Report

Attention: Patch coverage is 85.29412% with 10 lines in your changes missing coverage. Please review.

Project coverage is 45.45%. Comparing base (d522343) to head (c32576f).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../src/extensions/erc721/drops/write/claimToBatch.ts 85.29% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5124      +/-   ##
==========================================
+ Coverage   45.38%   45.45%   +0.06%     
==========================================
  Files        1064     1065       +1     
  Lines       55054    55122      +68     
  Branches     3965     3975      +10     
==========================================
+ Hits        24986    25054      +68     
  Misses      29376    29376              
  Partials      692      692              
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from d522343
packages 40.47% <85.29%> (+0.09%) ⬆️

*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 85.29% <85.29%> (ø)

... and 3 files with indirect coverage changes


describe.runIf(process.env.TW_SECRET_KEY)("ERC721: claimTo", () => {
it("isClaimToSupported should work", async () => {
const contract = getContract({
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we run this test against an existing contract? That way we don't rely on deploy which hits IPFS

@gregfromstl gregfromstl added the merge-queue Adds the pull request to Graphite's merge queue. label Oct 22, 2024
Copy link
Contributor

gregfromstl commented Oct 22, 2024

Merge activity

  • Oct 22, 5:47 PM EDT: The merge label 'merge-queue' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Oct 22, 5:48 PM EDT: A user added this pull request to the Graphite merge queue.
  • Oct 22, 5:52 PM EDT: The Graphite merge queue couldn't merge this PR because it was not satisfying all requirements (Failed CI: 'Unit Tests').
  • Oct 22, 11:38 PM EDT: A user added this pull request to the Graphite merge queue.
  • Oct 22, 11:42 PM EDT: A user merged this pull request with the Graphite merge queue.

gregfromstl pushed a commit that referenced this pull request Oct 22, 2024
## Problem solved

Short description of the bug fixed or feature added

<!-- start pr-codex -->

---

## PR-Codex overview
This PR introduces the `claimToBatch` functionality for the `ERC721` extension, allowing multiple NFT claims in a single transaction. It includes new tests for this feature and optimizes the claim content processing.

### Detailed summary
- Added `claimToBatch` function in `claimToBatch.ts` for batch NFT claims.
- Introduced `ClaimToBatchParams` type for defining batch claim parameters.
- Implemented `optimizeClaimContent` function to combine identical recipient claims.
- Created tests for `claimToBatch` and `optimizeClaimContent` in `claimToBatch.test.ts`.
- Updated `erc721.ts` to export `claimToBatch` and related types.

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

<!-- end pr-codex -->
@graphite-app graphite-app bot removed the merge-queue Adds the pull request to Graphite's merge queue. label Oct 22, 2024
## Problem solved

Short description of the bug fixed or feature added

<!-- start pr-codex -->

---

## PR-Codex overview
This PR introduces the `claimToBatch` functionality for the `ERC721` extension, allowing multiple claims in a single transaction. It includes tests to ensure the optimization of claim content and the correct processing of batch claims.

### Detailed summary
- Added `claimToBatch` function in `claimToBatch.ts` for batch claiming NFTs.
- Introduced `ClaimToBatchParams` type to define batch claim structure.
- Implemented `optimizeClaimContent` function to consolidate identical recipient claims.
- Created tests for `claimToBatch` and `optimizeClaimContent` in `claimToBatch.test.ts`.
- Verified the functionality of `isClaimToSupported` in the test suite.

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

<!-- end pr-codex -->
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.

3 participants