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

make ProofOfInclusion.root_hash a method, from a property #19177

Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 1 addition & 2 deletions chia/data_layer/data_layer_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ class ProofOfInclusion:
# children before parents
layers: list[ProofOfInclusionLayer]

@property
def root_hash(self) -> bytes32:
if len(self.layers) == 0:
return self.node_hash
Expand Down Expand Up @@ -315,7 +314,7 @@ def valid(self) -> bool:

existing_hash = calculated_hash

if existing_hash != self.root_hash:
if existing_hash != self.root_hash():
return False

return True
Expand Down
2 changes: 1 addition & 1 deletion chia/data_layer/data_layer_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -1272,7 +1272,7 @@ def verify_offer(
raise OfferIntegrityError("maker: invalid proof of inclusion found")

# TODO: verify each kv hash to the proof's node hash
roots = {proof.root_hash for proof in proofs}
roots = {proof.root_hash() for proof in proofs}
if len(roots) > 1:
raise OfferIntegrityError("maker: multiple roots referenced for a single store id")
if len(roots) < 1:
Expand Down
Loading