Skip to content

Conversation

@kien-ngo
Copy link
Contributor

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

Problem solved

Short description of the bug fixed or feature added


PR-Codex overview

This PR focuses on enhancing the padBytes function in to-bytes.ts for better testing and functionality, while also adding comprehensive test cases for various encoding utilities.

Detailed summary

  • Added JSDoc comment to padBytes in to-bytes.ts.
  • Exported padBytes for testing.
  • Introduced multiple test cases for byteSize, assertSize, charCodeToBase16, isHex, and toBytes functions.
  • Enhanced testing for boolToBytes, hexToBytes, numberToBytes, and stringToBytes functions.

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

@changeset-bot
Copy link

changeset-bot bot commented Nov 6, 2024

⚠️ No Changeset found

Latest commit: d8e7fae

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 Nov 6, 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.

@vercel
Copy link

vercel bot commented Nov 6, 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 6, 2024 7:20am
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 7:20am
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 7:20am
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 7:20am

@kien-ngo kien-ngo changed the title update [SDK] Test coverage Nov 6, 2024
Copy link
Contributor Author

kien-ngo commented Nov 6, 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

@kien-ngo kien-ngo marked this pull request as ready for review November 6, 2024 03:18
@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 43 KB (0%) 861 ms (0%) 2.4 s (-12.46% 🔽) 3.2 s
thirdweb (cjs) 103.04 KB (+0.04% 🔺) 2.1 s (+0.04% 🔺) 6.1 s (+3.01% 🔺) 8.1 s
thirdweb (minimal + tree-shaking) 4.85 KB (0%) 97 ms (0%) 213 ms (+78.92% 🔺) 310 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 67 ms (-69.76% 🔽) 77 ms
thirdweb/react (minimal + tree-shaking) 17.51 KB (0%) 351 ms (0%) 457 ms (+4.3% 🔺) 808 ms

@kien-ngo kien-ngo force-pushed the kien/test-coverage-run branch 2 times, most recently from f1b4228 to 70144b1 Compare November 6, 2024 06:44
@codecov
Copy link

codecov bot commented Nov 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 45.71%. Comparing base (a045479) to head (d8e7fae).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5316      +/-   ##
==========================================
+ Coverage   45.61%   45.71%   +0.10%     
==========================================
  Files        1068     1068              
  Lines       55557    55560       +3     
  Branches     4044     4062      +18     
==========================================
+ Hits        25341    25402      +61     
+ Misses      29526    29469      -57     
+ Partials      690      689       -1     
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from a045479
packages 40.85% <100.00%> (+0.13%) ⬆️

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

Files with missing lines Coverage Δ
packages/thirdweb/src/utils/encoding/to-bytes.ts 100.00% <100.00%> (+55.42%) ⬆️

... and 4 files with indirect coverage changes

@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 6, 2024

Merge activity

  • Nov 6, 2:08 AM EST: A user added this pull request to the Graphite merge queue.
  • Nov 6, 2:12 AM EST: The Graphite merge queue couldn't merge this PR because it was not satisfying all requirements (Failed CI: 'Unit Tests', 'check_linear_in_pr_body').
  • Nov 6, 2:22 AM EST: A user added this pull request to the Graphite merge queue.
  • Nov 6, 2:23 AM EST: A user merged this pull request with the Graphite merge queue.

## Problem solved

Short description of the bug fixed or feature added

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on adding new tests and enhancing the `padBytes` function in the `to-bytes.ts` file, along with implementing various utility functions for byte manipulation. It includes comprehensive test cases for hex strings, Uint8Arrays, and other conversions.

### Detailed summary
- Added JSDoc comment to `padBytes` function and exported it for testing.
- Introduced tests for `byteSize`, `assertSize`, `charCodeToBase16`, and `isHex` functions.
- Created tests for `padBytes`, `toBytes`, `boolToBytes`, `hexToBytes`, `numberToBytes`, and `stringToBytes` in `to-bytes.test.ts`.
- Enhanced test coverage for hex string conversions and error handling in byte manipulation functions.

> ✨ 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