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

Orchard Support for FROST UniFFI SDK #65

Merged
merged 1 commit into from
Aug 23, 2024
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
22 changes: 22 additions & 0 deletions FrostSwift/Sources/FrostSwift/Extensions/FrostSwift+Orchard.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// FrostSwift+Orchard.swift
//
//
// Created by pacu on 2024-08-17.
//

import FrostSwiftFFI

extension OrchardFullViewingKey: Equatable {
/// This method checks the equality of the UFVK by verifying that the encoded String is the same
/// this means that it will return true if the UFVK has the same viewing keys
/// - Note: Not really efficient.
/// - Returns: true if the encodings are the same. False if not or if any of the two throw.
public static func == (lhs: FrostSwiftFFI.OrchardFullViewingKey, rhs: FrostSwiftFFI.OrchardFullViewingKey) -> Bool {
guard let lhs = try? lhs.encode(), let rhs = try? rhs.encode() else {
return false
}

return lhs == rhs
}
}
Loading
Loading