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

feat: add Marshal and Unmarshal methods to SM(S)T proof types #21

Merged
merged 4 commits into from
Sep 9, 2023

Conversation

h5law
Copy link
Collaborator

@h5law h5law commented Sep 4, 2023

Description

Summary generated by Reviewpad on 06 Sep 23 15:52 UTC

This pull request introduces changes to the codebase related to serialization and deserialization of SparseMerkleProof and SparseCompactMerkleProof. The Marshal and Unmarshal methods are added to both structures to convert them to bytes and vice versa. Additionally, some tests are added for these serialization methods to ensure their correctness.

Issue

Fixes N/A

Type of change

Please mark the relevant option(s):

  • New feature, functionality or library
  • Bug fix
  • Code health or cleanup
  • Major breaking change
  • Documentation
  • Other

List of changes

  • Add Marshal and Unmarshal methods to both SM(S)T proof types
  • Add unit tests

Testing

  • Task specific tests or benchmarks: go test ...
  • New tests or benchmarks: go test ...
  • All tests: go test -v

Required Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added, or updated, godoc format comments on touched members (see: tip.golang.org/doc/comment)
  • I have tested my changes using the available tooling

If Applicable Checklist

  • Update any relevant README(s)
  • Add or update any relevant or supporting mermaid diagrams
  • I have added tests that prove my fix is effective or that my feature works

@h5law h5law added the enhancement New feature or request label Sep 4, 2023
@h5law h5law self-assigned this Sep 4, 2023
@reviewpad reviewpad bot added medium Pull request is medium waiting-for-review This PR is currently waiting to be reviewed labels Sep 4, 2023
@codecov
Copy link

codecov bot commented Sep 4, 2023

Codecov Report

Patch coverage: 76.00% and project coverage change: -0.20% ⚠️

Comparison is base (2876295) 84.89% compared to head (ba147fb) 84.69%.

Additional details and impacted files
@@             Coverage Diff             @@
##           kvstore      #21      +/-   ##
===========================================
- Coverage    84.89%   84.69%   -0.20%     
===========================================
  Files            8        8              
  Lines         1092     1117      +25     
===========================================
+ Hits           927      946      +19     
- Misses         122      126       +4     
- Partials        43       45       +2     
Files Changed Coverage Δ
proofs.go 88.46% <76.00%> (-1.99%) ⬇️

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

Copy link
Contributor

@red-0ne red-0ne left a comment

Choose a reason for hiding this comment

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

LGTM 👍

proofs_test.go Show resolved Hide resolved
proofs.go Outdated Show resolved Hide resolved
Copy link
Member

@Olshansk Olshansk left a comment

Choose a reason for hiding this comment

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

lgtm

@h5law h5law merged commit c353c6a into kvstore Sep 9, 2023
5 of 7 checks passed
@h5law h5law deleted the encode_proofs branch September 9, 2023 09:26
h5law added a commit that referenced this pull request Sep 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request medium Pull request is medium waiting-for-review This PR is currently waiting to be reviewed
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants