-
Notifications
You must be signed in to change notification settings - Fork 7
Skip operation effect validation for endpoints using Skip API call
#457
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
Changes from 4 commits
05ff86e
709e938
d558fda
7651a94
9632ce4
9396071
947fc6f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -10,7 +10,7 @@ import { | |||||
| import { oisSchema, type OIS, type Endpoint as oisEndpoint } from '@api3/ois'; | ||||||
| import { go, goSync } from '@api3/promise-utils'; | ||||||
| import { ethers } from 'ethers'; | ||||||
| import { isNil, uniqWith, isEqual } from 'lodash'; | ||||||
| import { isNil, uniqWith, isEqual, isEmpty, uniq } from 'lodash'; | ||||||
| import { z, type SuperRefinement } from 'zod'; | ||||||
|
|
||||||
| import packageJson from '../../package.json'; | ||||||
|
|
@@ -167,33 +167,53 @@ const validateTriggerReferences: SuperRefinement<{ | |||||
| }> = async (config, ctx) => { | ||||||
| const { ois: oises, templates, endpoints, triggers } = config; | ||||||
|
|
||||||
| for (const signedApiUpdate of triggers.signedApiUpdates) { | ||||||
| for (const [signedApiUpdateIndex, signedApiUpdate] of triggers.signedApiUpdates.entries()) { | ||||||
| const { templateIds } = signedApiUpdate; | ||||||
|
|
||||||
| // Verify all template IDs actually exist in the templates object | ||||||
| const referenceErrors = templateIds.map((templateId, templateIdIndex) => { | ||||||
| if (templates[templateId] === undefined) { | ||||||
| ctx.addIssue({ | ||||||
| code: z.ZodIssueCode.custom, | ||||||
| message: `Template ID "${templateId}" is not defined in the config.templates object`, | ||||||
|
||||||
| message: `Template ID "${templateId}" is not defined in the config.templates object`, | |
| message: `Template ID "${templateId}" is not defined`, |
if we ever refactor the config it can go stale.
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.
if we ever refactor the config it can go stale.
You're right but current version clearly points where the issue arises. I'd recommend to keep it.
Uh oh!
There was an error while loading. Please reload this page.