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

REST API: Fix LedgerStateDelta JSON encoding #6106

Merged
merged 14 commits into from
Aug 29, 2024

Conversation

jasonpaulos
Copy link
Contributor

@jasonpaulos jasonpaulos commented Aug 20, 2024

Summary

Removes the Txleases field from JSON state delta representations, as this field cannot be properly JSON encoded.

Based on #6100

Closes #6097

Test Plan

Test coverage added on all 3 endpoints.

@jasonpaulos jasonpaulos changed the title Fix state delta json REST API: Fix LedgerStateDelta JSON encoding Aug 20, 2024
Copy link

codecov bot commented Aug 20, 2024

Codecov Report

Attention: Patch coverage is 0% with 15 lines in your changes missing coverage. Please review.

Project coverage is 56.26%. Comparing base (23a04c2) to head (2621ac8).
Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
daemon/algod/api/server/v2/handlers.go 0.00% 11 Missing ⚠️
data/transactions/transaction.go 0.00% 2 Missing ⚠️
libgoal/libgoal.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6106      +/-   ##
==========================================
+ Coverage   56.25%   56.26%   +0.01%     
==========================================
  Files         490      490              
  Lines       69699    69704       +5     
==========================================
+ Hits        39206    39222      +16     
+ Misses      27825    27822       -3     
+ Partials     2668     2660       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

jannotti
jannotti previously approved these changes Aug 26, 2024
Copy link
Contributor

@jannotti jannotti left a comment

Choose a reason for hiding this comment

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

This looks like a fine fix to make sure the leases can be emitted as valid JSON. On the other hand, I'm struggling to see any value in sending the lease information at all, since it is very explicit already in the transaction (the sender, the lease, and the implied expiration from last valid).
Anyway, I'm ok with this, or zeroing the leases map before creating JSON.

daemon/algod/api/server/v2/handlers.go Outdated Show resolved Hide resolved
jannotti
jannotti previously approved these changes Aug 28, 2024
gmalouf
gmalouf previously approved these changes Aug 28, 2024
@jasonpaulos jasonpaulos dismissed stale reviews from gmalouf and jannotti via 2621ac8 August 29, 2024 15:59
@jasonpaulos jasonpaulos merged commit 9d5c4cd into algorand:master Aug 29, 2024
19 checks passed
@jasonpaulos jasonpaulos deleted the fix-state-delta-json branch August 29, 2024 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

REST API LedgerStateDelta.Txleases contains invalid JSON
6 participants