Skip to content

Commit

Permalink
revert naming to redactable
Browse files Browse the repository at this point in the history
  • Loading branch information
DougAnderson444 committed Jul 9, 2024
1 parent e3ebbb9 commit 1170b73
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions crates/delano-wallet-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,31 @@ pub struct DelanoWallet {
}

/// Optionally pass in NymProof and.or None when issuing credentials
#[derive(Serialize, Deserialize, Debug)]
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct IssueOptions {
pub nym_proof: NymProofCompressed,
pub nonce: Option<Vec<u8>>,
}

/// Specifies what [Entry]s to include, and which [Attribute]s to exclude from the cred.
/// Specifies which [Attribute]s to exclude from the cred, and their associated [Entry]s.
/// Can be None if no [Attribute]s are to be excluded.
///
/// # Note on Removing Attributes:
///
/// The [Credential] Offer Builder will remove the entire [Entry] containing an [Attribute] to
/// be removed. If you want to keep other [Attribute]s contained in that [Entry], you'll need
/// to add those [Attribute]s as an additional [Entry] using [OfferConfig].
#[derive(Serialize, Deserialize)]
pub struct Selectables {
#[derive(Serialize, Deserialize, Debug)]
pub struct Redactables {
pub entries: Vec<Entry>,
pub remove: Vec<Attribute>,
}

/// Configure the Offer: Optionally pass in [Selectables] and/or an additional [Entry].
/// Optionally set the maximum number of entries that can be added to the credential.
#[derive(Serialize, Deserialize)]
#[derive(Serialize, Deserialize, Debug)]
pub struct OfferConfig {
pub selected: Option<Selectables>,
pub redact: Option<Redactables>,
pub additional_entry: Option<Entry>,
/// Optionally reduces the number of entries that can be added to the credential.
pub max_entries: Option<u8>,
Expand Down Expand Up @@ -137,15 +138,15 @@ impl DelanoWallet {
Ok(cred_compressed.into())
}

// / Create an [CredentialCompressed] offer for the given [OfferConfig].
/// Create an [CredentialCompressed] offer for the given [OfferConfig].
pub fn offer(
&self,
cred: CredentialCompressed,
config: OfferConfig,
) -> Result<CredentialCompressed, String> {
let cred = Credential::try_from(cred).map_err(|e| e.to_string())?;

let (entries, redact) = match config.selected {
let (entries, redact) = match config.redact {
Some(includables) => {
let entries = includables.entries;
let redact = includables.remove;
Expand Down

0 comments on commit 1170b73

Please sign in to comment.