Skip to content

REST API: Fix LedgerStateDelta JSON encoding#6106

Merged
jasonpaulos merged 14 commits intoalgorand:masterfrom
jasonpaulos:fix-state-delta-json
Aug 29, 2024
Merged

REST API: Fix LedgerStateDelta JSON encoding#6106
jasonpaulos merged 14 commits intoalgorand:masterfrom
jasonpaulos:fix-state-delta-json

Conversation

@jasonpaulos
Copy link
Copy Markdown
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
Comment thread daemon/algod/api/server/v2/handlers.go Outdated
@codecov
Copy link
Copy Markdown

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.

Comment thread daemon/algod/api/server/v2/utils.go Outdated
Comment thread data/transactions/transaction.go
Comment thread daemon/algod/api/client/restClient.go
Comment thread daemon/algod/api/client/restClient.go
jannotti
jannotti previously approved these changes Aug 26, 2024
Copy link
Copy Markdown
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.

Comment thread daemon/algod/api/server/v2/handlers.go Outdated
jannotti
jannotti previously approved these changes Aug 28, 2024
Comment thread daemon/algod/api/server/v2/handlers.go Outdated
Comment thread daemon/algod/api/server/v2/utils.go Outdated
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
Comment thread daemon/algod/api/server/v2/handlers.go
@jasonpaulos jasonpaulos merged commit 9d5c4cd into algorand:master Aug 29, 2024
@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