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

[Chore] Update Record::is_owner documentation #2513

Merged
merged 4 commits into from
Oct 18, 2024
Merged
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
2 changes: 2 additions & 0 deletions console/program/src/data/record/is_owner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use super::*;

impl<N: Network> Record<N, Ciphertext<N>> {
/// Returns `true` if the given view key corresponds to the owner of the record.
/// Decrypts `self` into plaintext using the given view key.
pub fn is_owner(&self, view_key: &ViewKey<N>) -> bool {
// Compute the address.
Expand All @@ -24,6 +25,7 @@ impl<N: Network> Record<N, Ciphertext<N>> {
self.is_owner_with_address_x_coordinate(view_key, &address.to_x_coordinate())
}

/// Returns `true` if the given view key and address x-coordinate corresponds to the owner of the record.
/// Decrypts `self` into plaintext using the x-coordinate of the address corresponding to the given view key.
pub fn is_owner_with_address_x_coordinate(&self, view_key: &ViewKey<N>, address_x_coordinate: &Field<N>) -> bool {
// In debug mode, check that the address corresponds to the given view key.
Expand Down