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

Use our own json handle for decoding #765

Merged
merged 2 commits into from
Nov 3, 2021
Merged

Conversation

tolikzinovyev
Copy link
Contributor

Summary

We already use our own json handle for encoding. For consistency and to guard against changes in go-algorand, use the same json handle for decoding.

@codecov-commenter
Copy link

Codecov Report

Merging #765 (732f355) into develop (a5a575e) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #765      +/-   ##
===========================================
+ Coverage    55.17%   55.20%   +0.02%     
===========================================
  Files           27       28       +1     
  Lines         3815     3817       +2     
===========================================
+ Hits          2105     2107       +2     
  Misses        1435     1435              
  Partials       275      275              
Impacted Files Coverage Δ
idb/postgres/internal/encoding/encode.go 87.50% <ø> (-0.79%) ⬇️
idb/postgres/internal/encoding/decode.go 64.40% <100.00%> (+0.40%) ⬆️
idb/postgres/internal/encoding/encoding.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a5a575e...732f355. Read the comment docs.

Copy link
Contributor

@gmalouf gmalouf left a comment

Choose a reason for hiding this comment

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

Why move the jsonCodeHandle into a new encoding.go file in the same package? Readability, or is there something obvious I am missing?

Copy link
Contributor

@winder winder left a comment

Choose a reason for hiding this comment

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

I agree with the comments Brian made some time ago. I'd rather see encoding/decoding merged into a single file with all functions side-by-side. For me, separate encode/decode files make this code more difficult to read and review, further separation would make things even more difficult.

#611 (comment)

@tolikzinovyev
Copy link
Contributor Author

I agree with the comments Brian made some time ago. I'd rather see encoding/decoding merged into a single file with all functions side-by-side. For me, separate encode/decode files make this code more difficult to read and review, further separation would make things even more difficult.

#611 (comment)

I really think it's not a problem, as you can have two windows side-by-side, but I put encoding, decoding functions in the same file.

Copy link
Contributor

@winder winder left a comment

Choose a reason for hiding this comment

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

LGTM

@tolikzinovyev tolikzinovyev merged commit 04a0dcf into develop Nov 3, 2021
@tolikzinovyev tolikzinovyev deleted the tolik/json-decode branch November 3, 2021 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants