Skip to content

Commit

Permalink
Add == in MerkleNode
Browse files Browse the repository at this point in the history
  • Loading branch information
franciszekjob committed Oct 28, 2024
1 parent 009f27f commit 3d0393b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Sources/Starknet/Data/StorageProof/MerkleNode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ public enum MerkleNode: Codable, Equatable {
try container.encode(edgeNode)
}
}

public static func == (lhs: MerkleNode, rhs: MerkleNode) -> Bool {
switch (lhs, rhs) {
case let (.binaryNode(lhsBinaryNode), .binaryNode(rhsBinaryNode)):
lhsBinaryNode == rhsBinaryNode
case let (.edgeNode(lhsEdgeNode), .edgeNode(rhsEdgeNode)):
lhsEdgeNode == rhsEdgeNode
default:
false
}
}
}

public struct BinaryNode: Codable, Equatable {
Expand Down

0 comments on commit 3d0393b

Please sign in to comment.