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

SHARD-1113 #93

Merged
merged 3 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 73 additions & 57 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2892,6 +2892,18 @@ export const methods = {
countFailedResponse(api_name, 'filter not found')
return
}
//address may or may not be an array
if (Array.isArray(inputFilter.address) && inputFilter.address.length > 100) {
callback({ code: -32000, message: 'Invalid address' }, null)
countFailedResponse(api_name, 'Invalid address')
return
}
//filter topics should always be an array. If not array, or if array bigger than 200 elements, return error
if (!Array.isArray(inputFilter.topics) || inputFilter.topics.length > 200) {
callback({ code: -32000, message: 'Invalid topics' }, null)
countFailedResponse(api_name, 'Invalid topics')
return
}
const { address, topics } = parseFilterDetails(inputFilter || {})
// Add validate address
if (address && address.length !== 42) {
Expand Down
Loading