Skip to content

Conversation

@joaquim-verges
Copy link
Member

@joaquim-verges joaquim-verges commented Oct 4, 2024

Fixes CNCT-1987


PR-Codex overview

This PR focuses on improving the validation of fromBlock and toBlock inputs in the getContractEvents function to ensure they are properly defined. It fixes the handling of cases where these values might be 0n.

Detailed summary

  • Updated condition checks for fromBlock and toBlock to ensure they are not undefined.
  • Modified error handling to check for valid block ranges.
  • Adjusted logic for setting restParams.toBlock and restParams.fromBlock to account for inclusive ranges.

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

@vercel
Copy link

vercel bot commented Oct 4, 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 4, 2024 9:02pm
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 4, 2024 9:02pm
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 4, 2024 9:02pm
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 4, 2024 9:02pm

@changeset-bot
Copy link

changeset-bot bot commented Oct 4, 2024

🦋 Changeset detected

Latest commit: d4c423c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
thirdweb Patch

Not sure what this means? Click here to learn what changesets are.

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

@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 4, 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.

@linear
Copy link

linear bot commented Oct 4, 2024

@joaquim-verges joaquim-verges marked this pull request as ready for review October 4, 2024 08:05
Copy link
Member Author

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

Join @joaquim-verges and the rest of your teammates on Graphite Graphite

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 42.1 KB (+0.2% 🔺) 842 ms (+0.2% 🔺) 3 s (+29.76% 🔺) 3.8 s
thirdweb (cjs) 101.73 KB (-0.02% 🔽) 2.1 s (-0.02% 🔽) 5.4 s (-3.07% 🔽) 7.5 s
thirdweb (minimal + tree-shaking) 4.82 KB (0%) 97 ms (0%) 374 ms (+124.84% 🔺) 470 ms
thirdweb/chains (tree-shaking) 498 B (0%) 10 ms (0%) 93 ms (+22.34% 🔺) 103 ms
thirdweb/react (minimal + tree-shaking) 17.23 KB (0%) 345 ms (0%) 915 ms (+47.64% 🔺) 1.3 s

@codecov
Copy link

codecov bot commented Oct 4, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 47.60%. Comparing base (b6bf3b9) to head (d4c423c).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/thirdweb/src/event/actions/get-events.ts 75.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4919   +/-   ##
=======================================
  Coverage   47.60%   47.60%           
=======================================
  Files        1057     1057           
  Lines       57228    57228           
  Branches     3923     3924    +1     
=======================================
+ Hits        27241    27245    +4     
+ Misses      29298    29294    -4     
  Partials      689      689           
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from b6bf3b9
packages 43.36% <75.00%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
packages/thirdweb/src/event/actions/get-events.ts 79.16% <75.00%> (ø)

... and 3 files with indirect coverage changes

@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 4, 2024

Merge activity

Fixes CNCT-1987

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on improving the validation of `fromBlock` and `toBlock` parameters in the `getContractEvents` function to ensure they are explicitly defined before performing any calculations.

### Detailed summary
- Updated condition to check if `fromBlock` and `toBlock` are not `undefined` instead of truthy.
- Adjusted logic for setting `restParams.toBlock` and `restParams.fromBlock` based on the new checks.

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