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

Eas sdk #10

Merged
merged 3 commits into from
Aug 22, 2024
Merged

Eas sdk #10

merged 3 commits into from
Aug 22, 2024

Conversation

Behzad-rabiei
Copy link
Member

@Behzad-rabiei Behzad-rabiei commented Aug 22, 2024

Summary by CodeRabbit

  • New Features

    • Enhanced error handling and logging in authentication services.
    • Added EthersUtilsService for managing Ethereum providers and signers.
    • Introduced structured objects for supported chains and contracts.
  • Bug Fixes

    • Corrected command in pre-commit and pre-push hooks for linting.
  • Refactor

    • Streamlined methods for BigInt and string conversions in the Data Utils service.
    • Refactored test suites for clarity and maintainability.
    • Improved organization of authentication and attestation processes.
  • Chores

    • Updated dependencies for logging and configuration services.
  • Tests

    • Expanded testing coverage for new utility services and enhanced error handling.

Copy link

coderabbitai bot commented Aug 22, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

This update includes several modifications across various files related to error handling, logging, and service functionality. Key changes involve the restructuring of constants for supported chains, enhancements to token validation methods, adjustments in test setups, and the introduction of new utility services. Additionally, existing methods have been refactored for improved clarity and maintainability, while some have been removed to streamline the codebase.

Changes

Files Change Summary
.husky/pre-commit, .husky/pre-push Changed linting command from npx lint-staged to npx lint - staged, which may lead to errors due to the modified command syntax.
src/auth-siwe/dto/verify-siwe.dto.ts Renamed constant from SUPPORTED_CHAIN_IDS to SUPPORTED_CHAINS, updating related metadata and validation logic for chainId.
src/auth-siwe/siwe.service.spec.ts Replaced beforeEach with beforeAll for test setup, removed loggerMock initialization from setup.
src/auth-siwe/siwe.service.ts Simplified error logging by changing logging method parameters while maintaining error handling logic.
src/auth/auth.service.spec.ts Added LoggerModule, refactored mock configuration for ConfigService, changed expected error type in validateToken.
src/auth/auth.service.ts Introduced PinoLogger, modified validateToken method to include error logging and throw BadRequestException.
src/auth/oAuth.service.ts Simplified error logging in two asynchronous methods, retaining core operations unchanged.
src/eas/constants/attestation.constants.ts Changed SCHEMA_TYPES from parsed format to a raw string, altering how it's utilized in the code.
src/eas/eas.service.spec.ts Replaced ViemUtilsService with EthersUtilsService, refactored mock objects and integrated logging.
src/eas/eas.service.ts Refactored attestation handling, replaced properties with maps for improved structure, updated error handling, and simplified related methods.
src/linking/dto/link-identities.dto.ts Changed JWT provider for siweJwt from AUTH_PROVIDERS.SIWE to AUTH_PROVIDERS.GOOGLE.
src/linking/linking.controller.ts Hardcoded the secret for JWTs and updated methods for attestation requests and data formatting.
src/lit/lit.service.spec.ts Commented out various imports and test cases, updated mock implementations, and modified the logging strategy within tests.
src/lit/lit.service.ts Removed multiple methods for contract data retrieval, replaced with a centralized PERMISSION_CONTRACTS access, updated error handling strategy.
src/shared/constants/chain.constants.ts Transitioned SUPPORTED_CHAINS to a structured object format, introduced new constants for contracts and permissions.
src/shared/types/chain.type.ts Updated references from SUPPORTED_CHAIN_IDS to SUPPORTED_CHAINS in type definitions.
src/utils/data-utils.service.spec.ts Refactored test cases for BigInt conversions into distinct suites for clarity and specificity.
src/utils/data-utils.service.ts Replaced formatBigIntValues method with convertBigIntsToStrings and convertStringsToBigInts for improved handling of conversions.
src/utils/ethers.utils.service.spec.ts Added tests for EthersUtilsService, checking service instantiation and functionality of getProvider and getSigner methods.
src/utils/ethers.utils.service.ts Introduced EthersUtilsService class for managing Ethereum providers and signers, including getProvider and getSigner methods.
src/utils/utils.module.ts Added EthersUtilsService to module providers and exports, expanding module capabilities.
src/utils/viem.service.spec.ts Renamed constant SUPPORTED_CHAIN_IDS to SUPPORTED_CHAINS in tests.
src/utils/viem.utils.service.ts Updated usage of SUPPORTED_CHAIN_IDS to SUPPORTED_CHAINS within the service class.

Poem

In fields of code, where rabbits play,
New paths we carve, bright as the day.
With chains and tokens, we hop and twirl,
Each change a treasure, a coding pearl.
Through linting checks and services neat,
We celebrate progress, oh what a feat! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Behzad-rabiei Behzad-rabiei merged commit 8c882f0 into main Aug 22, 2024
13 checks passed
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.

2 participants