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

Merged
merged 21 commits into from
Dec 26, 2024
Merged

Add contracts endpoint #31

merged 21 commits into from
Dec 26, 2024

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 2 times, most recently 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 12502657968

Details

  • 113 of 121 (93.39%) changed or added relevant lines in 8 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.2%) to 90.801%

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 7 9 77.78%
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 12480747408: 0.2%
Covered Lines: 533
Relevant Lines: 587

💛 - 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
@moisses89 moisses89 force-pushed the add_contracts_endpoint branch from 5620389 to 00ec158 Compare December 26, 2024 10:15
@moisses89 moisses89 merged commit d9468c8 into main Dec 26, 2024
5 checks passed
@moisses89 moisses89 deleted the add_contracts_endpoint branch December 26, 2024 10:22
@github-actions github-actions bot locked and limited conversation to collaborators Dec 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add contracts endpoint by address
3 participants