-
Notifications
You must be signed in to change notification settings - Fork 10
fix: add check for nested empty JSON objects #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 6 commits
0c7e8f7
fe631ef
449b21a
1a30d72
5946303
1242b3a
b2bfa53
f5e9b68
75dc32e
69c179c
ac0290e
fc8e49a
5afaedc
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 |
|---|---|---|
| @@ -1,11 +1,12 @@ | ||
| import { describe, it, expect } from '@jest/globals'; | ||
| import { IExecDataProtector } from '../../src/index.js'; | ||
| import { getTestConfig } from '../test-utils.js'; | ||
|
|
||
| describe('When instantiating SDK without a signer', () => { | ||
| describe('When calling a read method', () => { | ||
| it('should work as expected', async () => { | ||
| // --- GIVEN | ||
| const dataProtector = new IExecDataProtector(); | ||
| const dataProtector = new IExecDataProtector(...getTestConfig()); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was connected to the production subgraph, causing the test to fail. |
||
|
|
||
| // --- WHEN/THEN | ||
| await expect( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -111,7 +111,8 @@ function recursiveParse( | |
|
|
||
| if (entry.value.kind == JSONValueKind.OBJECT) { | ||
| const object = entry.value.toObject(); | ||
| for (let i = 0; i < object.entries.length; i++) { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This for loop is a mistake. We shouldn’t keep it, I think.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, I don't have the history of this
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Le-Caignec do you remember why was it added?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no i think it's an issue |
||
| // Check that the object is not empty before recursion | ||
| if (object.entries.length > 0) { | ||
| accumulator = accumulator.concat(recursiveParse(object, path)); | ||
| } | ||
| } else if (entry.value.kind == JSONValueKind.STRING) { | ||
|
|
||
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.
We need runner connected to iexec infra to make deployment