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 latest block height to /addresses API endpoint #1701

Merged
merged 1 commit into from
Jun 14, 2024
Merged

Conversation

dydxwill
Copy link
Contributor

@dydxwill dydxwill commented Jun 14, 2024

Changelist

Add latest block height to /addresses API endpoint

Test Plan

Unit tested

Author/Reviewer Checklist

  • If this PR has changes that result in a different app state given the same prior state and transaction list, manually add the state-breaking label.
  • If the PR has breaking postgres changes to the indexer add the indexer-postgres-breaking label.
  • If this PR isn't state-breaking but has changes that modify behavior in PrepareProposal or ProcessProposal, manually add the label proposal-breaking.
  • If this PR is one of many that implement a specific feature, manually label them all feature:[feature-name].
  • If you wish to for mergify-bot to automatically create a PR to backport your change to a release branch, manually add the label backport/[branch-name].
  • Manually add any of the following labels: refactor, chore, bug.

Summary by CodeRabbit

  • New Features

    • Introduced latestProcessedBlockHeight field in various API responses to provide additional block height information.
  • Documentation

    • Updated API documentation to include the latestProcessedBlockHeight field.
  • Tests

    • Enhanced test cases to cover the new latestProcessedBlockHeight property.
  • Refactor

    • Modified functions and method calls to support the new latestProcessedBlockHeight parameter.

Copy link
Contributor

coderabbitai bot commented Jun 14, 2024

Walkthrough

The recent modifications across multiple files in the project introduce a new field, latestProcessedBlockHeight, to enhance API responses and test cases by providing additional block height information. These changes ensure that responses now include the most recent processed block height alongside the existing height data, improving the clarity and richness of information available to users and facilitating more precise data handling and testing.

Changes

File Path Change Summary
indexer/services/comlink/__tests__/.../addresses-controller.test.ts Added latestProcessedBlockHeight property to several test case objects.
indexer/services/comlink/public/api-documentation.md Introduced latestProcessedBlockHeight field in various API responses.
indexer/services/comlink/public/swagger.json Added latestProcessedBlockHeight field and updated required fields.
indexer/services/comlink/src/controllers/api/v4/addresses-controller.ts Included latestBlock.blockHeight in method calls and updated getSubaccountResponse function to accept latestBlockHeight.
indexer/services/comlink/src/request-helpers/request-transformer.ts Modified subaccountToResponseObject function to accept and use latestBlockHeight.
indexer/services/comlink/src/types.ts Added latestProcessedBlockHeight property to SubaccountResponseObject interface.

Poem

In code, a tale of blocks we're told,
With latest heights, our data bold.
APIs enriched, tests now clear,
Block heights shine, end users cheer.
With swift new heights, our code does sing,
Data flows like a springtime ring. 🌸

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 Configration 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f3b6fd7 and f75840e.

Files selected for processing (6)
  • indexer/services/comlink/tests/controllers/api/v4/addresses-controller.test.ts (10 hunks)
  • indexer/services/comlink/public/api-documentation.md (7 hunks)
  • indexer/services/comlink/public/swagger.json (2 hunks)
  • indexer/services/comlink/src/controllers/api/v4/addresses-controller.ts (5 hunks)
  • indexer/services/comlink/src/request-helpers/request-transformer.ts (2 hunks)
  • indexer/services/comlink/src/types.ts (1 hunks)
Files not reviewed due to errors (1)
  • indexer/services/comlink/public/swagger.json (no review received)
Additional context used
Biome
indexer/services/comlink/src/controllers/api/v4/addresses-controller.ts

[error] 85-85: Decorators are not valid here. (parse)

Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting the unsafeParameterDecoratorsEnabled option to true in your configuration file.


[error] 172-172: Decorators are not valid here. (parse)

Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting the unsafeParameterDecoratorsEnabled option to true in your configuration file.


[error] 173-173: Decorators are not valid here. (parse)

Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting the unsafeParameterDecoratorsEnabled option to true in your configuration file.


[error] 252-252: Decorators are not valid here. (parse)

Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting the unsafeParameterDecoratorsEnabled option to true in your configuration file.


[error] 253-253: Decorators are not valid here. (parse)

Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting the unsafeParameterDecoratorsEnabled option to true in your configuration file.

LanguageTool
indexer/services/comlink/public/api-documentation.md

[formatting] ~11-~11: If the ‘because’ clause is essential to the meaning, do not use a comma before the clause. (COMMA_BEFORE_BECAUSE)
Context: ...than data fetched via Indexer's REST API, because the latter is backed by read replicas o...


[misspelling] ~2898-~2898: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...id="schemaperpetualpositionstatus"> </a...


[misspelling] ~2899-~2899: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...d="schema_PerpetualPositionStatus"> <...


[misspelling] ~2924-~2924: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...onSide <a id="to...


[misspelling] ~2925-~2925: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ..."> <a id="tocsp...


[misspelling] ~2949-~2949: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...IsoString <a id="tocSi...


[misspelling] ~2950-~2950: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...ing"> <a id="tocsisos...


[misspelling] ~2967-~2967: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...maperpetualpositionresponseobject"> <a id="schema_PerpetualPositionResponseObj...


[misspelling] ~2968-~2968: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...a_PerpetualPositionResponseObject"> <a id="tocSperpetualpositionresponseobject...


[misspelling] ~3017-~3017: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...a id="schemaperpetualpositionsmap"> ...


[misspelling] ~3018-~3018: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ... id="schema_PerpetualPositionsMap"> <a ...


[misspelling] ~3072-~3072: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...schemaassetpositionresponseobject"> <a id="schema_AssetPositionResponseObject"...


[misspelling] ~3073-~3073: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...chema_AssetPositionResponseObject"> </...


[misspelling] ~3100-~3100: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...p <a i...


[misspelling] ~3101-~3101: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...> <a id="...


[misspelling] ~3133-~3133: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...d="schemasubaccountresponseobject"> </...


[misspelling] ~3134-~3134: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...="schema_SubaccountResponseObject"> ...


[misspelling] ~3221-~3221: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...nse <a id=...


[misspelling] ~3222-~3222: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: .../a> <a id="to...


[misspelling] ~3307-~3307: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...d="schemaparentsubaccountresponse"> </...


[misspelling] ~3308-~3308: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...="schema_ParentSubaccountResponse"> ...


[misspelling] ~3399-~3399: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...a id="schemaassetpositionresponse"> ...


[misspelling] ~3400-~3400: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ... id="schema_AssetPositionResponse"> <a ...


[misspelling] ~3427-~3427: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...on <a id...


[misspelling] ~3428-~3428: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...a> <a id="t...


[misspelling] ~3457-~3457: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ... <...


[misspelling] ~3458-~3458: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...a id="schema_CandleResponseObject"> <a i...


[misspelling] ~3499-~3499: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...onse <a id="...


[misspelling] ~3500-~3500: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ... <a id="toc...


[misspelling] ~3534-~3534: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...us <a id...


[misspelling] ~3535-~3535: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...a> <a id="t...


[misspelling] ~3562-~3562: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...on <a id...


[misspelling] ~3563-~3563: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...a> <a id="t...


[misspelling] ~3590-~3590: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ... <...


[misspelling] ~3591-~3591: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...a id="schema_ComplianceV2Response"> <a i...


[misspelling] ~3614-~3614: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...OrderSide <a id="tocSo...


[misspelling] ~3615-~3615: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...ide"> <a id="tocsorde...


[misspelling] ~3639-~3639: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...Liquidity <a id="tocSl...


[misspelling] ~3640-~3640: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...ity"> <a id="tocsliqu...


[misspelling] ~3664-~3664: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...# FillType <a id="tocSfi...


[misspelling] ~3665-~3665: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...type"> <a id="tocsfillt...


[misspelling] ~3692-~3692: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...rketType <a id="tocS...


[misspelling] ~3693-~3693: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...pe"> <a id="tocsmar...


[misspelling] ~3717-~3717: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ... <a ...


[misspelling] ~3718-~3718: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ... <a id=...


[misspelling] ~3763-~3763: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...sponse <a id="to...


[misspelling] ~3764-~3764: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ..."> <a id="tocsf...


[misspelling] ~3806-~3806: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...onse <a id="...


[misspelling] ~3807-~3807: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ... <a id="toc...


[misspelling] ~3828-~3828: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...chemahistoricalblocktradingreward"> <a id="schema_HistoricalBlockTradingReward...


[misspelling] ~3829-~3829: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...hema_HistoricalBlockTradingReward"> <...


[misspelling] ~3852-~3852: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...oricalblocktradingrewardsresponse"> <a id="schema_HistoricalBlockTradingReward...


[misspelling] ~3853-~3853: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...oricalBlockTradingRewardsResponse"> <a id="tocShistoricalblocktradingrewardsre...


[misspelling] ~3878-~3878: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...mahistoricalfundingresponseobject"> <a id="schema_HistoricalFundingResponseObj...


[misspelling] ~3879-~3879: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...a_HistoricalFundingResponseObject"> <a id="tocShistoricalfundingresponseobject...


[misspelling] ~3906-~3906: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...="schemahistoricalfundingresponse"> <...


[misspelling] ~3907-~3907: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ..."schema_HistoricalFundingResponse"> ...


[misspelling] ~3934-~3934: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ... id="schemapnlticksresponseobject"> ...


[misspelling] ~3935-~3935: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...id="schema_PnlTicksResponseObject"> <a...


[misspelling] ~3968-~3968: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...a id="schemahistoricalpnlresponse"> ...


[misspelling] ~3969-~3969: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ... id="schema_HistoricalPnlResponse"> <a ...


[misspelling] ~4005-~4005: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...ematradingrewardaggregationperiod"> <a id="schema_TradingRewardAggregationPeri...


[misspelling] ~4006-~4006: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...ma_TradingRewardAggregationPeriod"> <a id="tocStradingrewardaggregationperiod"...


[misspelling] ~4031-~4031: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...istoricaltradingrewardaggregation"> <a id="schema_HistoricalTradingRewardAggre...


[misspelling] ~4032-~4032: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...istoricalTradingRewardAggregation"> <a id="tocShistoricaltradingrewardaggregat...


[misspelling] ~4061-~4061: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...tradingrewardaggregationsresponse"> <a id="schema_HistoricalTradingRewardAggre...


[misspelling] ~4062-~4062: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...TradingRewardAggregationsResponse"> <a id="tocShistoricaltradingrewardaggregat...


[misspelling] ~4090-~4090: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...schemaorderbookresponsepricelevel"> <a id="schema_OrderbookResponsePriceLevel"...


[misspelling] ~4091-~4091: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...chema_OrderbookResponsePriceLevel"> </...


[misspelling] ~4112-~4112: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...id="schemaorderbookresponseobject"> </a...


[misspelling] ~4113-~4113: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...d="schema_OrderbookResponseObject"> <...


[misspelling] ~4144-~4144: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...orce <a id="...


[misspelling] ~4145-~4145: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ... <a id="toc...


[misspelling] ~4170-~4170: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...rStatus <a id="toc...


[misspelling] ~4171-~4171: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...s"> <a id="tocsor...


[misspelling] ~4198-~4198: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ... id="schemabesteffortopenedstatus"> ...


[misspelling] ~4199-~4199: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...id="schema_BestEffortOpenedStatus"> <a...


[misspelling] ~4222-~4222: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...atus <a id="...


[misspelling] ~4223-~4223: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ... <a id="toc...


[misspelling] ~4248-~4248: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...OrderType <a id="tocSo...


[misspelling] ~4249-~4249: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...ype"> <a id="tocsorde...


[misspelling] ~4278-~4278: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ... <a...


[misspelling] ~4279-~4279: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ... <a id...


[misspelling] ~4342-~4342: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...a id="schemaperpetualmarketstatus"> ...


[misspelling] ~4343-~4343: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ... id="schema_PerpetualMarketStatus"> <a ...


[misspelling] ~4371-~4371: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ... <a...


[misspelling] ~4372-~4372: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ... <a id...


[misspelling] ~4396-~4396: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...hemaperpetualmarketresponseobject"> <a id="schema_PerpetualMarketResponseObjec...


[misspelling] ~4397-~4397: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...ema_PerpetualMarketResponseObject"> ...


[misspelling] ~4456-~4456: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...id="schemaperpetualmarketresponse"> </a...


[misspelling] ~4457-~4457: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...d="schema_PerpetualMarketResponse"> <...


[misspelling] ~4524-~4524: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...="schemaperpetualpositionresponse"> <...


[misspelling] ~4525-~4525: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ..."schema_PerpetualPositionResponse"> ...


[misspelling] ~4563-~4563: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...id="schemasparklineresponseobject"> </a...


[misspelling] ~4564-~4564: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...d="schema_SparklineResponseObject"> <...


[misspelling] ~4588-~4588: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ... <a...


[misspelling] ~4589-~4589: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ... <a id...


[misspelling] ~4613-~4613: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...sponse <a id="to...


[misspelling] ~4614-~4614: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ..."> <a id="tocst...


[misspelling] ~4635-~4635: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...TradeType <a id="tocSt...


[misspelling] ~4636-~4636: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...ype"> <a id="tocstrad...


[misspelling] ~4661-~4661: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ... <a...


[misspelling] ~4662-~4662: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ... <a id...


[misspelling] ~4693-~4693: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...ponse <a id="t...


[misspelling] ~4694-~4694: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...> <a id="tocs...


[misspelling] ~4729-~4729: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...erType <a id="to...


[misspelling] ~4730-~4730: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ..."> <a id="tocst...


[misspelling] ~4756-~4756: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ... id="schematransferresponseobject"> ...


[misspelling] ~4757-~4757: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...id="schema_TransferResponseObject"> <a...


[misspelling] ~4802-~4802: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...se <a id...


[misspelling] ~4803-~4803: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...a> <a id="t...


[misspelling] ~4846-~4846: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ...aparentsubaccounttransferresponse"> <a id="schema_ParentSubaccountTransferResp...


[misspelling] ~4847-~4847: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
Context: ..._ParentSubaccountTransferResponse"> <a id="tocSparentsubaccounttransferrespons...

Markdownlint
indexer/services/comlink/public/api-documentation.md

4888-4888: Expected: 1; Actual: 2 (MD012, no-multiple-blanks)
Multiple consecutive blank lines


72-72: null (MD028, no-blanks-blockquote)
Blank line inside blockquote


212-212: null (MD028, no-blanks-blockquote)
Blank line inside blockquote


347-347: null (MD028, no-blanks-blockquote)
Blank line inside blockquote


492-492: null (MD028, no-blanks-blockquote)
Blank line inside blockquote


577-577: null (MD028, no-blanks-blockquote)
Blank line inside blockquote


677-677: null (MD028, no-blanks-blockquote)
Blank line inside blockquote


766-766: null (MD028, no-blanks-blockquote)
Blank line inside blockquote


858-858: null (MD028, no-blanks-blockquote)
Blank line inside blockquote


968-968: null (MD028, no-blanks-blockquote)
Blank line inside blockquote


1056-1056: null (MD028, no-blanks-blockquote)
Blank line inside blockquote


1134-1134: null (MD028, no-blanks-blockquote)
Blank line inside blockquote


1217-1217: null (MD028, no-blanks-blockquote)
Blank line inside blockquote


1308-1308: null (MD028, no-blanks-blockquote)
Blank line inside blockquote


1405-1405: null (MD028, no-blanks-blockquote)
Blank line inside blockquote


1507-1507: null (MD028, no-blanks-blockquote)
Blank line inside blockquote


1590-1590: null (MD028, no-blanks-blockquote)
Blank line inside blockquote


1700-1700: null (MD028, no-blanks-blockquote)
Blank line inside blockquote


1894-1894: null (MD028, no-blanks-blockquote)
Blank line inside blockquote


2063-2063: null (MD028, no-blanks-blockquote)
Blank line inside blockquote


2160-2160: null (MD028, no-blanks-blockquote)
Blank line inside blockquote


2296-2296: null (MD028, no-blanks-blockquote)
Blank line inside blockquote


2404-2404: null (MD028, no-blanks-blockquote)
Blank line inside blockquote


2506-2506: null (MD028, no-blanks-blockquote)
Blank line inside blockquote


2579-2579: null (MD028, no-blanks-blockquote)
Blank line inside blockquote


2658-2658: null (MD028, no-blanks-blockquote)
Blank line inside blockquote


2752-2752: null (MD028, no-blanks-blockquote)
Blank line inside blockquote


2854-2854: null (MD028, no-blanks-blockquote)
Blank line inside blockquote


1765-1765: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


1771-1771: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


1777-1777: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


1959-1959: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


1965-1965: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


1971-1971: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading

Additional comments not posted (12)
indexer/services/comlink/src/types.ts (1)

67-67: Added latestProcessedBlockHeight to SubaccountResponseObject. Ensure all functions that construct this object are updated accordingly.

indexer/services/comlink/src/controllers/api/v4/addresses-controller.ts (1)

159-159: The latestBlock.blockHeight is consistently passed to getSubaccountResponse across different endpoints. Ensure this value is correctly handled within the function.

Also applies to: 245-245, 329-329

indexer/services/comlink/src/request-helpers/request-transformer.ts (1)

Line range hint 313-334: Updated subaccountToResponseObject to include latestBlockHeight. This change aligns with the updated SubaccountResponseObject type definition.

indexer/services/comlink/__tests__/controllers/api/v4/addresses-controller.test.ts (3)

85-85: The addition of latestProcessedBlockHeight to the API response is correctly implemented here. Ensure that the value of latestHeight is being set and retrieved as expected in all relevant tests.


164-164: The implementation of latestProcessedBlockHeight in scenarios with asset positions is correctly handled. It’s good to see consistent updates across different test cases.


250-250: The consistent addition of latestProcessedBlockHeight across various subaccount responses is well done. This ensures that the new field is available in all relevant API responses, aligning with the PR's objectives.

Also applies to: 302-302, 313-313, 324-324, 363-363, 448-448, 500-500, 519-519

indexer/services/comlink/public/api-documentation.md (6)

138-139: The addition of the latestProcessedBlockHeight field in the GetAddress API example response is consistent with the PR objectives. This change should help users obtain the latest block height information directly from the API response, which could be crucial for applications that need to track block heights for transactions or other blockchain-related operations.


276-277: The addition of the latestProcessedBlockHeight field in the GetSubaccount API example response is appropriately implemented. This ensures that users querying specific subaccounts can also receive the latest block height, which is useful for maintaining the context of the data with respect to the blockchain state.


417-418: The inclusion of latestProcessedBlockHeight in the GetParentSubaccount API example response is well-placed. This will allow users who are managing hierarchical accounts to track the block height at which the latest updates occurred, providing a temporal context to the retrieved data.
[APROVED]


3199-3200: It's good to see the latestProcessedBlockHeight field added to the SubaccountResponseObject schema. This field is critical for ensuring that the schema definitions are up-to-date with the example responses provided in the API documentation. This addition will help developers understand the data model more accurately when integrating with the API.


3289-3290: Adding latestProcessedBlockHeight to the AddressResponse schema is a necessary update to keep the schema in sync with the API responses shown in the documentation. This consistency between the schema and the actual API response is crucial for developers who rely on the documentation for implementing API integrations.


3379-3380: The addition of latestProcessedBlockHeight to the ParentSubaccountResponse schema is correctly implemented. This ensures that the schema accurately reflects the data that can be expected in the API responses, particularly for those managing parent subaccounts, which is often critical in hierarchical account structures.

@dydxwill dydxwill merged commit 0357775 into main Jun 14, 2024
11 checks passed
@dydxwill dydxwill deleted the wl/latest_bh branch June 14, 2024 18:26
@dydxwill
Copy link
Contributor Author

@Mergifyio backport release/indexer/v5.x

Copy link
Contributor

mergify bot commented Jun 27, 2024

backport release/indexer/v5.x

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Jun 27, 2024
(cherry picked from commit 0357775)

# Conflicts:
#	indexer/services/comlink/__tests__/controllers/api/v4/addresses-controller.test.ts
#	indexer/services/comlink/public/api-documentation.md
#	indexer/services/comlink/public/swagger.json
#	indexer/services/comlink/src/request-helpers/request-transformer.ts
#	indexer/services/comlink/src/types.ts
dydxwill added a commit that referenced this pull request Jun 27, 2024
…1803)

Co-authored-by: dydxwill <119354122+dydxwill@users.noreply.github.com>
Co-authored-by: Will Liu <will@dydx.exchange>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants