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

plugin chainbase: test coverage and config #3071

Closed
ai16z-demirix opened this issue Jan 30, 2025 · 0 comments
Closed

plugin chainbase: test coverage and config #3071

ai16z-demirix opened this issue Jan 30, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@ai16z-demirix
Copy link
Contributor

Is your feature request related to a problem? Please describe.

The Chainbase plugin is expected to require comprehensive test coverage to ensure reliable interaction with the Chainbase API. Without proper testing, issues such as incorrect token balance retrieval, API timeout handling, and error management are likely to surface in production. The plugin should be thoroughly tested to handle various scenarios including successful queries, API failures, and timeout conditions.

Describe the solution you'd like

A comprehensive test suite should be implemented for the plugin-chainbase package using vitest. The test coverage is expected to include:

  1. Token Balance Actions:
    • Tests should be written to validate proper handling of token balance retrieval
    • Input validation should be implemented for chain IDs and addresses
    • Response formatting should be tested for various token decimal places
  2. Query Execution:
    • Tests should be created to verify SQL query execution
    • Timeout scenarios should be properly handled with configurable retry attempts
    • Error cases should be tested including API failures and invalid responses
  3. Mock Implementation:
    • The Chainbase API responses should be properly mocked
    • Timer functions should be mocked to test timeout scenarios
    • Environment variables should be managed within tests
  4. Code Organization:
    • Tests should be structured similarly to the plugin-bootstrap package
    • Test files should be organized by feature (actions, libs)
    • Common test utilities should be shared across test files

Describe alternatives you've considered

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants