-
Notifications
You must be signed in to change notification settings - Fork 307
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
Peregrine Data External Adapter Submission #3590
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 481efb8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to run yarn as well as yarn test peregrine-fund-admin/test
packages/sources/peregrine-fund-admin/src/config/overrides.json
Outdated
Show resolved
Hide resolved
packages/sources/peregrine-fund-admin/test/integration/fixtures.ts
Outdated
Show resolved
Hide resolved
once changes are made, please run |
// `request` contains any valid axios request configuration | ||
request: { | ||
baseURL: config.DEFAULT_BASE_URL, | ||
url: config.DEFAULT_RESERVE_URL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this supposed to include the assetId as a path param the end?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are now API search query params, I just need to include the assetId as path a variable on the end. This is true for both end points.
i.e. https://www.myfoo.com/api/v1/nav/100, https://www.myfoo.com/api/v1/reserves/100
https://www.myfoo.com/api/v1/reserves/{assetId}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think i see the suggestion now will update with param injected into the endpoint string for the prepareRequest
packages/sources/peregrine-fund-admin/test/integration/fixtures.ts
Outdated
Show resolved
Hide resolved
packages/sources/peregrine-fund-admin/test/integration/fixtures.ts
Outdated
Show resolved
Hide resolved
this has now been run and commited in latest for this PR. |
this has been run. |
what is the correct way to run test in my directory? I tried yarn test, etc. |
yarn test peregrine-fund-admin/test in root |
Thank you I have now pushed the latest commit with 2 passing integration tests, at least locally passing. Please see if test pass as well. |
Looks like you need to run yarn again |
I also didn't see you latest commit |
` PASS packages/sources/peregrine-fund-admin/test/integration/adapter.test.ts Test Suites: 1 passed, 1 total Please confirm running the integration tests pass as expected. |
}, | ||
API_RESERVE_ENDPOINT: { | ||
description: 'API Endpoint to get the latest Proof of Reserves for a given asset', | ||
type: 'string', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The values seems to be lost?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just need 1 changeset for the PR, please mark it major
instead of patch
required: true, | ||
sensitive: true, | ||
}, | ||
API_BASE_URL: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be what @mxiao-cll is mentioning below, but should there be default URLs here as there were in the original commit?
} | ||
|
||
export const endpoint = new AdapterEndpoint({ | ||
// Endpoint name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can get rid of the comments in this object
} | ||
|
||
export const endpoint = new AdapterEndpoint({ | ||
// Endpoint name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here too please
import { nav, reserve } from './endpoint' | ||
|
||
export const adapter = new Adapter({ | ||
//Requests will direct to this endpoint if the `endpoint` input parameter is not specified. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here
// `request` contains any valid axios request configuration | ||
request: { | ||
baseURL: config.API_BASE_URL, | ||
url: config.API_NAV_ENDPOINT, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is still missing the assetId
, isn't it?
return { | ||
params: param, | ||
response: { | ||
result: Number(response.data.equityNav), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't follow the earlier discussion very closely but I think what you might be looking for here is something like the following:
add to nav inputParameters
trancheSelector: {
required: true,
type: 'string',
options: ['equityNav', 'seniorNAV', 'juniorNav'],
description: 'The tranche to use as result',
},
then here
result: Number(response.data[param.trancheSelector])
plus necessary validation/verification where appropriate
Please run end to end manual tests as well on the package.
and request against your local EA with a curl like this (plus any additional params you add)
hope this will help with the e2e debugging 🙏 |
export interface ResponseSchema { | ||
Id: string | null | ||
assetId: string | ||
seniorNAV: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also I'm curious why this senior NAV
is capitalized while junior and equity use Nav
?
Closes #ISSUE_NUMBER_GOES_HERE
Description
......
Changes
Steps to Test
Quality Assurance
infra-k8s
configuration file.adapter-secrets
configuration file or update the soak testing blacklist.test-payload.json
file with relevant requests.feature/x
,chore/x
,release/x
,hotfix/x
,fix/x
) or is created from Jira.