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

feat: support exactOptionalPropertyTypes #1969

Merged
merged 4 commits into from
Mar 17, 2024
Merged

feat: support exactOptionalPropertyTypes #1969

merged 4 commits into from
Mar 17, 2024

Conversation

jxom
Copy link
Member

@jxom jxom commented Mar 17, 2024

fixes #1955


PR-Codex overview

This PR focuses on adding support for undefined types in various parts of the codebase for better type safety and clarity.

Detailed summary

  • Added support for undefined types in multiple type definitions for enhanced type safety.
  • Updated function parameters to accept undefined values where applicable.
  • Improved clarity by specifying undefined types in various object properties.

The following files were skipped due to too many changes: src/actions/wallet/writeContract.ts, src/utils/errors/getEstimateGasError.ts, src/chains/opStack/actions/estimateInitiateWithdrawalGas.ts, src/chains/opStack/actions/estimateDepositTransactionGas.ts, src/errors/account.ts, src/utils/errors/getContractError.ts, src/actions/public/watchBlockNumber.ts, src/chains/opStack/actions/estimateFinalizeWithdrawalGas.ts, src/chains/opStack/actions/getTimeToProve.ts, src/actions/public/getProof.ts, src/utils/address/getAddress.ts, src/chains/zksync/utils/isEip712Transaction.ts, src/utils/typedData.ts, src/actions/public/watchPendingTransactions.ts, src/utils/rpc/socket.ts, src/actions/public/getBalance.ts, src/chains/opStack/decorators/publicL2.ts, src/chains/zksync/types/eip712.ts, src/utils/poll.ts, src/utils/transaction/parseTransaction.ts, src/actions/public/getTransactionCount.ts, src/utils/abi/encodeErrorResult.ts, src/utils/abi/encodeEventTopics.ts, src/utils/ens/avatar/parseAvatarRecord.ts, src/chains/opStack/types/withdrawal.ts, src/utils/abi/encodeFunctionData.ts, src/utils/abi/decodeFunctionResult.ts, src/actions/public/getFeeHistory.ts, src/utils/abi/encodeFunctionResult.ts, src/actions/ens/getEnsName.ts, src/utils/formatters/log.ts, src/utils/transaction/assertRequest.ts, tsconfig.base.json, src/chains/opStack/actions/buildInitiateWithdrawal.ts, src/chains/opStack/actions/getTimeToNextL2Output.ts, src/actions/ens/getEnsText.ts, src/utils/errors/getNodeError.ts, src/chains/opStack/actions/waitForNextL2Output.ts, src/types/stateOverride.ts, src/actions/public/simulateContract.ts, src/utils/formatters/proof.ts, src/utils/abi/formatAbiItem.ts, src/actions/public/estimateGas.ts, src/errors/rpc.ts, src/actions/getContract.test-d.ts, src/chains/opStack/actions/getL1BaseFee.ts, src/chains/zksync/utils/assertEip712Request.ts, src/types/block.ts, src/clients/transports/custom.ts, src/clients/createClient.test-d.ts, src/errors/transaction.ts, src/errors/chain.ts, src/utils/formatters/transactionReceipt.ts, src/actions/public/getBlockTransactionCount.ts, src/utils/promise/withRetry.ts, src/chains/opStack/types/transaction.ts, src/actions/ens/getEnsAddress.ts, src/actions/getContract.ts, src/chains/opStack/formatters.test-d.ts, src/types/filter.ts, src/utils/formatters/transactionRequest.ts, src/errors/request.ts, src/chains/zksync/utils/assertEip712Transaction.ts, src/actions/public/getContractEvents.ts, src/utils/formatters/block.ts, src/chains/celo/parsers.ts, src/utils/formatters/transaction.ts, src/actions/public/getBlock.ts, src/utils/encoding/fromBytes.ts, src/types/contract.ts, src/types/fee.ts, src/utils/transaction/getTransactionType.ts, src/utils/promise/withTimeout.ts, src/actions/public/estimateMaxPriorityFeePerGas.ts, src/chains/celo/serializers.ts, src/chains/opStack/types/deposit.ts, src/chains/celo/formatters.test-d.ts, src/utils/encoding/fromHex.ts, src/actions/public/estimateFeesPerGas.ts, src/accounts/types.ts, src/clients/transports/ipc.ts, src/clients/createClient.ts, src/errors/base.ts, src/actions/public/createContractEventFilter.ts, src/clients/transports/webSocket.ts, src/actions/public/getTransaction.ts, src/chains/opStack/actions/buildDepositTransaction.ts, src/utils/encoding/toBytes.ts, src/utils/promise/createBatchScheduler.ts, src/actions/public/waitForTransactionReceipt.ts, src/types/utils.ts, src/chains/zksync/formatters.test-d.ts, src/errors/abi.ts, src/clients/transports/createTransport.ts, src/actions/public/watchEvent.ts, src/utils/rpc/http.ts, src/actions/wallet/prepareTransactionRequest.ts, src/utils/encoding/toHex.ts, src/actions/public/getLogs.ts, src/types/rpc.ts, src/utils/transaction/serializeTransaction.ts, src/actions/public/createEventFilter.ts, src/utils/data/slice.ts, src/clients/transports/http.ts, src/actions/public/call.ts, src/errors/contract.ts, src/chains/zksync/types/transaction.ts, src/clients/transports/fallback.ts, src/clients/decorators/public.ts, src/chains/celo/types.ts, src/types/eip1193.ts, src/errors/node.ts, src/types/transaction.ts

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

Copy link

changeset-bot bot commented Mar 17, 2024

🦋 Changeset detected

Latest commit: 1c97f13

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

This PR includes changesets to release 1 package
Name Type
viem 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

Copy link

vercel bot commented Mar 17, 2024

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

Name Status Preview Updated (UTC)
viem ✅ Ready (Inspect) Visit Preview Mar 17, 2024 5:34am

Copy link

codecov bot commented Mar 17, 2024

Codecov Report

Attention: Patch coverage is 99.86720% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 99.77%. Comparing base (c11dad4) to head (1c97f13).
Report is 7 commits behind head on main.

Files Patch % Lines
src/utils/promise/withTimeout.ts 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1969      +/-   ##
==========================================
- Coverage   99.78%   99.77%   -0.01%     
==========================================
  Files         573      574       +1     
  Lines       50432    50594     +162     
  Branches     2517     2517              
==========================================
+ Hits        50323    50480     +157     
- Misses         96       99       +3     
- Partials       13       15       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented Mar 17, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
viem (esm) 66.11 KB (+0.01% 🔺) 1.4 s (+0.01% 🔺) 3 s (-52.78% 🔽) 4.4 s
viem (cjs) 85.85 KB (+0.01% 🔺) 1.8 s (+0.01% 🔺) 7.8 s (+79.23% 🔺) 9.5 s
viem (minimal surface - tree-shaking) 3.72 KB (+0.14% 🔺) 75 ms (+0.14% 🔺) 243 ms (+52.64% 🔺) 317 ms
viem/accounts 91.45 KB (0%) 1.9 s (0%) 2.7 s (+62.75% 🔺) 4.6 s
viem/accounts (tree-shaking) 21.08 KB (0%) 422 ms (0%) 823 ms (-62.16% 🔽) 1.3 s
viem/actions 46.62 KB (0%) 933 ms (0%) 942 ms (-33.18% 🔽) 1.9 s
viem/actions (tree-shaking) 340 B (0%) 10 ms (0%) 18 ms (-6.02% 🔽) 28 ms
viem/chains 29.85 KB (0%) 598 ms (0%) 910 ms (-6.23% 🔽) 1.6 s
viem/chains (tree-shaking) 367 B (0%) 10 ms (0%) 42 ms (-22.8% 🔽) 52 ms
viem/chains/utils 1.16 KB (0%) 24 ms (0%) 29 ms (-12.54% 🔽) 52 ms
viem/ens 46.62 KB (0%) 933 ms (0%) 898 ms (-24.42% 🔽) 1.9 s
viem/ens (tree-shaking) 20.61 KB (0%) 413 ms (0%) 738 ms (+13.02% 🔺) 1.2 s

@jxom jxom merged commit b6f5916 into main Mar 17, 2024
23 of 30 checks passed
@jxom jxom deleted the jxom/exact-optional branch March 17, 2024 05:35
@github-actions github-actions bot mentioned this pull request Mar 17, 2024
@tmm tmm mentioned this pull request Mar 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: incompatible types
1 participant