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

feat: 🎸 Retrieve instruction info from middleware(if available) #1369

Open
wants to merge 2 commits into
base: alpha
Choose a base branch
from

Conversation

prashantasdeveloper
Copy link
Collaborator

Description

Add option to query information from middleware for instruction related methods.

Breaking Changes

🧨 Methods in the Instruction entity that retrieve information from the
chain were updated to use middleware for fetching data, when available. If middleware is
unavailable, the methods will continue to fetch data directly from the chain.
The following methods were modified with this logic: details, getAffirmations, getLegs,
getMediators, getOffChainAffirmations, getOffChainAffirmationForLeg.
When querying via middleware, these methods will now throw an error in the following cases:
a. If the instruction does not exist.
b.If the instruction data has not yet been processed by the middleware.
Also, the pagination options for getAffirmations and getLegs now supports
MiddlewarePaginationOptions as well (when querying via middleware)

JIRA Link

DA-1369

Checklist

  • Updated the Readme.md (if required) ?

BREAKING CHANGE: 🧨 Methods in the `Instruction` entity that retrieve information from the
chain were updated to use middleware for fetching data, when available. If middleware is
unavailable, the methods will continue to fetch data directly from the chain.
The following methods were modified with this logic: `details`, `getAffirmations`, `getLegs`,
`getMediators`, `getOffChainAffirmations`, `getOffChainAffirmationForLeg`.
When querying via middleware, these methods will now throw an error in the following cases:
  a. If the instruction does not exist.
  b.If the instruction data has not yet been processed by the middleware.
Also, the pagination options for `getAffirmations` and `getLegs` now supports
`MiddlewarePaginationOptions` as well (when querying via middleware)
@prashantasdeveloper prashantasdeveloper requested a review from a team as a code owner November 19, 2024 10:40
Copy link

sonarcloud bot commented Nov 19, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
97.6% Coverage on New Code (required ≥ 100%)
1 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Copy link
Collaborator

@polymath-eric polymath-eric left a comment

Choose a reason for hiding this comment

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

Why add MiddlewarePaginationOptions. Just PaginationOptions should be fine. They have the same interface so we shouldn't need two types.

@@ -89,6 +89,11 @@ export interface PaginationOptions {
start?: string;
}

export interface MiddlewarePaginationOptions {
Copy link
Collaborator

Choose a reason for hiding this comment

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

export interface PaginationOptions {

We already have this interface, just with a different name

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