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

Clarify OIS processing tests #141

Merged
merged 2 commits into from
Mar 28, 2024
Merged

Clarify OIS processing tests #141

merged 2 commits into from
Mar 28, 2024

Conversation

Siegrift
Copy link
Contributor

@Siegrift Siegrift commented Mar 27, 2024

@Siegrift Siegrift requested a review from dcroote March 27, 2024 17:44
@Siegrift Siegrift self-assigned this Mar 27, 2024
@Siegrift Siegrift force-pushed the more-accurate-processing-tests branch from 7d261b7 to 02fcfa0 Compare March 27, 2024 17:51
src/ois.test.ts Outdated
@@ -714,7 +714,7 @@ describe('API call skip validation', () => {
ois.endpoints[0].preProcessingSpecificationV2 = {
environment: 'Node',
timeoutMs: 5000,
value: 'output = input;',
value: '({ response }) => { return { response: Math.round(Math.random() * 1000) } }',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

You can see this working in api3dao/signed-api#280

Copy link
Contributor

Choose a reason for hiding this comment

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

Nit, but isn't this correct for post-processing but incorrect for pre-processing?

The payload argument for pre-processing is an object with the following property:

endpointParameters - The endpoint parameters with the exception of reserved parameters. For example, if there was a parameter named myParameter defined in the endpoints[n].parameters array, its value could be accessed using endpointParameters.myParameter within pre-processing snippet.
The output of the pre-processing snippet is an object with the following property:

endpointParameters - The pre-processed endpoint parameters parameters. These are used to make the API call.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@dcroote dcroote left a comment

Choose a reason for hiding this comment

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

LGTM

@Siegrift Siegrift merged commit 464d90d into main Mar 28, 2024
3 checks passed
@Siegrift Siegrift deleted the more-accurate-processing-tests branch March 28, 2024 16:01
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.

Pre/Post Processing V2 clarification
2 participants