[DF-22956] fix casing issue blocksize capital EA#4780
Open
Conversation
🦋 Changeset detectedLatest commit: 07bab75 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
cl-efornaciari
requested changes
Mar 27, 2026
| aliases: ['crypto', 'state'], | ||
| transport: stateTransport, | ||
| inputParameters, | ||
| requestTransforms: [blocksizeStateSubscriptionRequestTransform], |
Contributor
There was a problem hiding this comment.
Should be blocksizeStateSubscriptionRequestTransform()? We should align on one pattern and stick with it
Comment on lines
+3
to
+10
| export function blocksizeStateSubscriptionRequestTransform() { | ||
| return (req: AdapterRequest<{ base: string; quote?: string }>) => { | ||
| req.requestContext.data.base = req.requestContext.data.base.toLowerCase() | ||
| if (req.requestContext.data.quote) { | ||
| req.requestContext.data.quote = req.requestContext.data.quote.toLowerCase() | ||
| } | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
this uses the same pattern as tiingo, which we know is not working. How are these tests passing?
Comment on lines
+94
to
+105
| it('should normalize mixed-case base and quote params', async () => { | ||
| const response = await testAdapter.request({ | ||
| base: 'CbBtC', | ||
| quote: 'uSd', | ||
| endpoint: 'state', | ||
| }) | ||
| const body = response.json() | ||
|
|
||
| expect(response.statusCode).toBe(200) | ||
| expect(body.result).toBe(1234.56) | ||
| expect(body.data.result).toBe(1234.56) | ||
| }) |
Contributor
There was a problem hiding this comment.
how does this work if the transform is not properly set up?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #DF-22956
Description
DF-22956
This change makes both Blocksize adapters handle symbol casing consistently by normalizing incoming base and quote params before subscription logic runs.
It does two things:
blocksize-capital-state now uses the same request transform pattern already used by blocksize-capital, so mixed-case inputs like CbBtC/uSd are normalized before building subscription state.
Test coverage was expanded across both adapters to verify casing behavior at both the unit and integration level.
Changes
Steps to Test
Focused tests passed for both adapters:
blocksize-capital: 9/9 tests passed
blocksize-capital-state: 32/32 tests passed
If you want, I can also turn this into a polished GitHub PR title and body.
Quality Assurance
infra-k8sconfiguration file.adapter-secretsconfiguration file.test-payload.jsonfile with relevant requests.feature/x,chore/x,release/x,hotfix/x,fix/x) or is created from Jira.