-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
7d261b7
to
02fcfa0
Compare
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) } }', |
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 see this working in api3dao/signed-api#280
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.
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.
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.
Potential replacement value: https://docs.api3.org/reference/ois/latest/specification.html#_5-11-preprocessingspecificationv2
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.
LGTM
Resolves api3dao/vitepress-docs#715 (comment)