diff --git a/Sources/Starknet/Data/StorageProof/MerkleNode.swift b/Sources/Starknet/Data/StorageProof/MerkleNode.swift index 42fea19e..00a34b2b 100644 --- a/Sources/Starknet/Data/StorageProof/MerkleNode.swift +++ b/Sources/Starknet/Data/StorageProof/MerkleNode.swift @@ -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 {