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 JSON Encoding of strings in wasm-storage Events #135

Merged
merged 1 commit into from
Dec 15, 2023
Merged

Conversation

jim380
Copy link
Contributor

@jim380 jim380 commented Dec 15, 2023

Overview

JSON strings are enclosed in double quotes, hence the backslash (\) used to escape special characters. In our case, the hash string is being serialized as a JSON string, which is why it's enclosed in double quotes and the backslashes are escaped.

What's Changed

A wrapper is created for both EventStoreDataRequestWasm and EventStoreOverlayWasmWrapper embed the type and override MarshalJSON.

Testing

$ cd x/wasm-storage/keeper
$ go test -run TestMarshalJSON

PASS
ok      github.com/sedaprotocol/seda-chain/x/wasm-storage/keeper        0.364s

Related PRs and Issues

Closes #118

@jim380 jim380 merged commit 0c81500 into main Dec 15, 2023
5 of 6 checks passed
@jim380 jim380 deleted the jay/issue-118 branch December 15, 2023 04:00
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.

🐛 Module events contain stringified strings ""value""
2 participants