Skip to content

Avoid double serialization in RPC tests#7547

Merged
emlautarom1 merged 11 commits into
refactor/transaction-for-rpc-hierarchyfrom
refactor/rpc-test-parameter-serialization
Oct 4, 2024
Merged

Avoid double serialization in RPC tests#7547
emlautarom1 merged 11 commits into
refactor/transaction-for-rpc-hierarchyfrom
refactor/rpc-test-parameter-serialization

Conversation

@emlautarom1

Copy link
Copy Markdown
Contributor

Fixes #7483 (comment)

Changes

  • Avoid double serialization in test code that exercises RPC endpoints.

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a change that causes existing functionality not to work as expected)
  • Optimization
  • Refactoring
  • Documentation update
  • Build-related changes
  • Other: Description

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Notes on testing

Updated tests accordingly without changing existing behavior.

Documentation

Requires documentation update

  • Yes
  • No

Requires explanation in Release Notes

  • Yes
  • No

Remarks

During #7483 we found out that our testing code could potentially result in double serialization of objects. For example, instead of

{ "foo": 42 }

we would get

"{\"foo\": 42 }"

This PR addresses this issue avoiding double serialization. This also reduces the code in several test cases where we no longer need to instantiate a JSON serializer.

Due to the goal of this PR it should be reviewed independently of other refactoring PRs.

@emlautarom1 emlautarom1 changed the title Refactor/rpc test parameter serialization Avoid double serialization in RPC tests Oct 3, 2024
@emlautarom1 emlautarom1 merged commit 5002733 into refactor/transaction-for-rpc-hierarchy Oct 4, 2024
@emlautarom1 emlautarom1 deleted the refactor/rpc-test-parameter-serialization branch October 4, 2024 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants