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

fix(rpc): Fix bigint serialisation in API responses #1644

Merged
merged 1 commit into from
Aug 18, 2023

Conversation

spalladino
Copy link
Collaborator

Fixes error in Sandbox getting started where querying the balance for a user would cause a Koa error.

@spalladino spalladino enabled auto-merge (squash) August 18, 2023 12:08
@socket-security
Copy link

New dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
@types/lodash.clonedeepwith 4.5.7 None +0 3.88 kB types
lodash.clonedeepwith 4.5.0 None +0 48.5 kB jdalton


test('does not convert a string', () => {
expect(convertBigintsInObj('hello')).toEqual('hello');
expect(convertBigintsInObj({ msg: 'hello' })).toEqual({ msg: 'hello' });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this expected over a throw Error?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the idea is that convertBigints would just returns the same data structure it received, but replacing any bigints it sees along the way. If there are no bigints, no changes needed.

The reason for this test is that the original implementation looped over strings as if they were collections, so I wanted to make sure there were no errors related to dealing with strings.

@spalladino spalladino merged commit d1ce814 into master Aug 18, 2023
@spalladino spalladino deleted the palla/fix-bigints-serialisation branch August 18, 2023 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants