-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
fix: Increase token name validation length and perf improvement when processing #11171
base: develop
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
5 Skipped Deployments
|
const add = `${(error as any).dataPath} ${error.message ?? ''}` | ||
return memo.length > 0 ? `${memo}; ${add}` : `${add}` | ||
}, '') ?? 'unknown error' | ||
if (json.tokens) { | ||
remove<TokenInfo>(json.tokens, (token) => { | ||
return !tokenListValidator({ ...json, tokens: [token] }) |
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.
no need to do process all token one by one since in error message indices can be obtained
Having token to be filtered out for the name which it shouldn't
Token list https://tokens.pancakeswap.finance/pancakeswap-base-default.json validation failed before token filtering: .tokens[43].name should NOT be longer than 40 characters; should match "else" schema
PR-Codex overview
This PR focuses on improving the validation and error handling for fetching and processing token lists in the
pancakeswap
schema and thegetTokenList
function. It enhances the maximum length of token descriptions and introduces better error management during the fetch process.Detailed summary
maxLength
of token description from 40 to 50.response
tojson
ingetTokenList.ts
.