Skip to content

[SDK] Fix: allow 0 values for gasPrice #5841

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

Merged
merged 1 commit into from
Dec 27, 2024
Merged

Conversation

d4mr
Copy link
Member

@d4mr d4mr commented Dec 26, 2024

Problem solved

Allow 0 value for gasPrice, important for gasless chains
Fixes TOOL-2865


PR-Codex overview

This PR updates the conditional check for gasPrice in the fee-data.ts file to ensure it specifically checks if gasPrice is of type bigint, enhancing type safety.

Detailed summary

  • Changed the condition from if (gasPrice) to if (typeof gasPrice === "bigint") in the fee-data.ts file.
  • This modification ensures that the subsequent code block only executes when gasPrice is a bigint.

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

@d4mr d4mr requested review from a team as code owners December 26, 2024 19:05
Copy link

vercel bot commented Dec 26, 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 Dec 27, 2024 8:08pm
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 27, 2024 8:08pm
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 27, 2024 8:08pm
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 27, 2024 8:08pm

Copy link

changeset-bot bot commented Dec 26, 2024

⚠️ No Changeset found

Latest commit: 71eaf8f

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

graphite-app bot commented Dec 26, 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
Contributor

github-actions bot commented Dec 26, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 45.07 KB (+0.1% 🔺) 902 ms (+0.1% 🔺) 345 ms (+58.5% 🔺) 1.3 s
thirdweb (cjs) 110.94 KB (+0.16% 🔺) 2.3 s (+0.16% 🔺) 591 ms (-8.97% 🔽) 2.9 s
thirdweb (minimal + tree-shaking) 5.58 KB (0%) 112 ms (0%) 150 ms (+346.31% 🔺) 262 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 37 ms (+336.78% 🔺) 47 ms
thirdweb/react (minimal + tree-shaking) 19.12 KB (0%) 383 ms (0%) 179 ms (+147.98% 🔺) 562 ms

Copy link

codecov bot commented Dec 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 54.52%. Comparing base (1556615) to head (71eaf8f).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5841      +/-   ##
==========================================
- Coverage   54.53%   54.52%   -0.01%     
==========================================
  Files        1105     1105              
  Lines       59332    59332              
  Branches     4924     4921       -3     
==========================================
- Hits        32354    32349       -5     
- Misses      26258    26263       +5     
  Partials      720      720              
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from 1556615
packages 52.01% <100.00%> (-0.02%) ⬇️

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

Files with missing lines Coverage Δ
packages/thirdweb/src/gas/fee-data.ts 72.41% <100.00%> (ø)

... and 2 files with indirect coverage changes

Copy link

linear bot commented Dec 27, 2024

@gregfromstl gregfromstl added the merge-queue Adds the pull request to Graphite's merge queue. label Dec 27, 2024
Copy link
Member

gregfromstl commented Dec 27, 2024

Merge activity

  • Dec 27, 2:59 PM EST: The merge label 'merge-queue' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Dec 27, 2:59 PM EST: A user added this pull request to the Graphite merge queue.
  • Dec 27, 3:08 PM EST: A user merged this pull request with the Graphite merge queue.

## Problem solved

Allow `0` value for gasPrice, important for gasless chains
Fixes TOOL-2865

<!-- start pr-codex -->

---

## PR-Codex overview
This PR modifies the conditional check for `gasPrice` in the `fee-data.ts` file to ensure it specifically checks if `gasPrice` is of type `bigint` instead of just checking its truthiness.

### Detailed summary
- Changed the condition from `if (gasPrice)` to `if (typeof gasPrice === "bigint")` in the `fee-data.ts` file.
- This ensures that only values of type `bigint` are considered valid for `gasPrice`.

> ✨ 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
merge-queue Adds the pull request to Graphite's merge queue. packages SDK Involves changes to the thirdweb SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants