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

806 endpoint to fetch state leaf based on cah #809

Merged

Conversation

ognjenkurtic
Copy link
Collaborator

Description

Extends the e2e test to verify that state and history tree entries are correct, as well as verify that the state tree leaf value can be correctly fetched by using content addressable hash.

Related Issue

#806

Motivation and Context

Verification that proper storage happens after each tx execution

How Has This Been Tested

e2e test extended

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Request to be added as a Code Owner/Maintainer

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I commit to abide by the Responsibilities of Code Owners/Maintainers.

@@ -24,14 +24,18 @@ export class BpiMerkleTree {

public addLeaf(leaf: string): void {
const bufferLeaf = Buffer.from(leaf, 'utf-8');
this.tree.addLeaf(bufferLeaf, true);
this.tree.addLeaf(bufferLeaf, false);
Copy link
Collaborator

Choose a reason for hiding this comment

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

why false? @ognjenkurtic

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

since the leaf is already a sha265 hash, i thought that we do not need additional hashing when storing the leaf.

Copy link
Collaborator

@Therecanbeonlyone1969 Therecanbeonlyone1969 left a comment

Choose a reason for hiding this comment

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

LGTM

@Therecanbeonlyone1969 Therecanbeonlyone1969 merged commit 8bd669a into develop Jul 18, 2024
2 checks passed
@Therecanbeonlyone1969 Therecanbeonlyone1969 deleted the 806-endpoint-to-fetch-state-leaf-based-on-cah branch July 18, 2024 14:41
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.

2 participants