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

Add contracts endpoint #31

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open

Add contracts endpoint #31

wants to merge 20 commits into from

Conversation

moisses89
Copy link
Member

@moisses89 moisses89 commented Dec 17, 2024

Description

  • Add the contracts endpoint following the next schema
{
  "count": 0,
  "next": "string",
  "previous": "string",
  "results": [
    {
      "address": "string",
      "name": "string",
      "display_name": "string",
      "chain_id": 0,
      "project": {
        "description": "string",
        "logo_file": "string"
      },
      "abi": {
        "abi_json": [
          {}
        ],
        "abi_hash": "string"
      }
    }
  ]
}
  • Implement pagination for this endpoint and for future endpoints

Issue related

Close #12

@moisses89 moisses89 force-pushed the add_contracts_endpoint branch from 7b94070 to 36cb892 Compare December 19, 2024 08:46
@moisses89 moisses89 force-pushed the add_contracts_endpoint branch from 36cb892 to a4b4315 Compare December 19, 2024 08:47
@coveralls
Copy link

coveralls commented Dec 19, 2024

Pull Request Test Coverage Report for Build 12430455829

Details

  • 116 of 124 (93.55%) changed or added relevant lines in 8 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.9%) to 89.268%

Changes Missing Coverage Covered Lines Changed/Added Lines %
app/routers/contracts.py 11 13 84.62%
app/routers/models.py 33 35 94.29%
app/services/contract.py 6 8 75.0%
app/services/pagination.py 38 40 95.0%
Files with Coverage Reduction New Missed Lines %
app/services/contract.py 1 78.57%
Totals Coverage Status
Change from base Build 12375882360: 0.9%
Covered Lines: 366
Relevant Lines: 410

💛 - Coveralls

@moisses89 moisses89 marked this pull request as ready for review December 19, 2024 16:12
@moisses89 moisses89 requested a review from a team as a code owner December 19, 2024 16:12
app/datasources/db/models.py Show resolved Hide resolved
app/datasources/db/models.py Outdated Show resolved Hide resolved
app/datasources/db/models.py Show resolved Hide resolved
app/routers/about.py Outdated Show resolved Hide resolved
app/routers/contracts.py Outdated Show resolved Hide resolved
if not fast_is_checksum_address(address):
raise HTTPException(status_code=400, detail="Address is not checksumed")

contracts_service = ContractService(request)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing the request to the service and instantiating one service for every client does not sound right to me

app/routers/models.py Outdated Show resolved Hide resolved
app/services/contract.py Outdated Show resolved Hide resolved
@moisses89 moisses89 requested a review from Uxio0 December 20, 2024 11:13
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.

Add contracts endpoint by address
3 participants