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] Refactor: More Viem to Ox migration #5790

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Conversation

gregfromstl
Copy link
Member

@gregfromstl gregfromstl commented Dec 18, 2024

Problem solved

Short description of the bug fixed or feature added


PR-Codex overview

This PR focuses on replacing instances of maxUint256 imported from viem with maxUint256 from ox/Solidity, along with some adjustments in the workflow configuration and type definitions.

Detailed summary

  • Updated imports for maxUint256 from viem to ox/Solidity in multiple files.
  • Modified .github/workflows/auto-assign.yml to include ready_for_review and draft in the pull_request triggers.
  • Changed type definitions in various files to use types from ox packages.

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

Copy link

vercel bot commented Dec 18, 2024

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

Name Status Preview Comments Updated (UTC)
docs-v2 ❌ Failed (Inspect) Dec 23, 2024 11:19pm
thirdweb_playground ❌ Failed (Inspect) Dec 23, 2024 11:19pm
thirdweb-www ❌ Failed (Inspect) Dec 23, 2024 11:19pm
wallet-ui ❌ Failed (Inspect) Dec 23, 2024 11:19pm

Copy link

graphite-app bot commented Dec 18, 2024

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

Copy link

changeset-bot bot commented Dec 18, 2024

⚠️ No Changeset found

Latest commit: a9887a1

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
Contributor

github-actions bot commented Dec 18, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 45.84 KB (+2% 🔺) 917 ms (+2% 🔺) 770 ms (-79.37% 🔽) 1.7 s
thirdweb (cjs) 114.03 KB (+2.88% 🔺) 2.3 s (+2.88% 🔺) 1.7 s (-83.27% 🔽) 3.9 s
thirdweb (minimal + tree-shaking) 5.58 KB (0%) 112 ms (0%) 200 ms (+5.59% 🔺) 311 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 67 ms (-19.82% 🔽) 77 ms
thirdweb/react (minimal + tree-shaking) 19.1 KB (+0.14% 🔺) 382 ms (+0.14% 🔺) 196 ms (-80.3% 🔽) 578 ms

@gregfromstl gregfromstl marked this pull request as ready for review December 18, 2024 10:37
@gregfromstl gregfromstl requested review from a team as code owners December 18, 2024 10:37
@gregfromstl gregfromstl changed the title [SDK] Refactor: Viem to Ox migration [SDK] Refactor: More Viem to Ox migration Dec 18, 2024
Copy link

codecov bot commented Dec 18, 2024

Codecov Report

Attention: Patch coverage is 71.11111% with 26 lines in your changes missing coverage. Please review.

Project coverage is 53.02%. Comparing base (7d8566e) to head (36de96f).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
packages/thirdweb/src/auth/verify-signature.ts 31.03% 20 Missing ⚠️
packages/thirdweb/src/auth/verify-hash.ts 54.54% 5 Missing ⚠️
...ages/thirdweb/src/utils/abi/encodeAbiParameters.ts 92.85% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5790      +/-   ##
==========================================
- Coverage   53.02%   53.02%   -0.01%     
==========================================
  Files        1101     1101              
  Lines       59080    59122      +42     
  Branches     4810     4811       +1     
==========================================
+ Hits        31328    31349      +21     
- Misses      27034    27055      +21     
  Partials      718      718              
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from 70a6bd4
packages 50.16% <71.11%> (-0.01%) ⬇️

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

Files with missing lines Coverage Δ
packages/thirdweb/src/auth/is-erc6492-signature.ts 100.00% <100.00%> (ø)
...kages/thirdweb/src/auth/parse-erc6492-signature.ts 100.00% <100.00%> (ø)
packages/thirdweb/src/auth/verify-typed-data.ts 100.00% <100.00%> (ø)
.../src/contract/deployment/utils/create-2-factory.ts 69.23% <100.00%> (+2.71%) ⬆️
...ges/thirdweb/src/extensions/ens/resolve-l2-name.ts 90.90% <100.00%> (+2.02%) ⬆️
...es/thirdweb/src/extensions/erc1155/read/getNFTs.ts 100.00% <100.00%> (ø)
...es/thirdweb/src/extensions/erc1155/write/mintTo.ts 100.00% <100.00%> (ø)
...irdweb/src/extensions/erc1155/write/mintToBatch.ts 93.10% <100.00%> (ø)
...s/thirdweb/src/extensions/erc1155/write/sigMint.ts 95.19% <ø> (ø)
...ons/modules/ClaimableERC1155/setClaimConditions.ts 97.18% <100.00%> (ø)
... and 7 more

... and 3 files with indirect coverage changes

@vercel vercel bot temporarily deployed to Preview – thirdweb_playground December 18, 2024 21:13 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 December 18, 2024 21:13 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui December 18, 2024 21:13 Inactive
@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Dec 18, 2024
@gregfromstl gregfromstl self-assigned this Dec 18, 2024
@@ -103,9 +113,35 @@
accountFactory,
}: VerifyContractWalletSignatureParams) {
const messageHash = hashMessage(message);

const parsedSignature = (() => {
Copy link
Member

Choose a reason for hiding this comment

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

this seems a bit scary? maybe add tests for these sub cases?

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a few tests and removed signature object support (we can't support it until we re-add 1271 support. What's scary about it though? It's just parsing the input to the format we prefer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dashboard Involves changes to the Dashboard. packages SDK Involves changes to the thirdweb SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants