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

[INDY-1137] Making proof possible for given root hash #575

Merged
merged 3 commits into from
Mar 19, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions plenum/server/domain_req_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def getNymDetails(state, nym, isCommitted: bool=True):
def nym_to_state_key(nym: str) -> bytes:
return sha256(nym.encode()).digest()

def make_proof(self, path):
def make_proof(self, path, headHash=None):
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use snake case

Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a test for this

'''
Creates a state proof for the given path in state trie.
Returns None if there is no BLS multi-signature for the given state (it can
Expand All @@ -174,7 +174,7 @@ def make_proof(self, path):
proof = self.state.generate_state_proof(key=path,
root=self.state.committedHead,
serialize=True)
root_hash = self.state.committedHeadHash
root_hash = headHash if headHash else self.state.committedHeadHash
encoded_proof = proof_nodes_serializer.serialize(proof)
encoded_root_hash = state_roots_serializer.serialize(bytes(root_hash))

Expand Down