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

fix: return the updated credential from process_credential() #9

Merged
merged 13 commits into from
Dec 18, 2023
8 changes: 7 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,21 @@ jobs:
- name: "Install Linux GNU for x86_64"
run: |
rm '/usr/local/bin/2to3'
rm '/usr/local/bin/2to3-3.11'
rm '/usr/local/bin/2to3-3.12'
rm '/usr/local/bin/python3'
rm '/usr/local/bin/python3.11'
rm '/usr/local/bin/2to3-3.11'
rm '/usr/local/bin/python3.12'
rm '/usr/local/bin/idle3'
rm '/usr/local/bin/idle3.11'
rm '/usr/local/bin/idle3.12'
rm '/usr/local/bin/pydoc3'
rm '/usr/local/bin/pydoc3.11'
rm '/usr/local/bin/pydoc3.12'
rm '/usr/local/bin/python3-config'
rm '/usr/local/bin/python3.11-config'
rm '/usr/local/bin/python3.12-config'
rm -r '/usr/local/lib/node_modules'
brew install --overwrite x86_64-unknown-linux-gnu

- name: "Install Linux GNU for aarch64"
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,21 @@ jobs:
- name: "Install Linux GNU for x86_64"
run: |
rm '/usr/local/bin/2to3'
rm '/usr/local/bin/2to3-3.11'
rm '/usr/local/bin/2to3-3.12'
rm '/usr/local/bin/python3'
rm '/usr/local/bin/python3.11'
rm '/usr/local/bin/2to3-3.11'
rm '/usr/local/bin/python3.12'
rm '/usr/local/bin/idle3'
rm '/usr/local/bin/idle3.11'
rm '/usr/local/bin/idle3.12'
rm '/usr/local/bin/pydoc3'
rm '/usr/local/bin/pydoc3.11'
rm '/usr/local/bin/pydoc3.12'
rm '/usr/local/bin/python3-config'
rm '/usr/local/bin/python3.11-config'
rm '/usr/local/bin/python3.12-config'
rm -r '/usr/local/lib/node_modules'
brew install --overwrite x86_64-unknown-linux-gnu

- name: "Install Linux GNU for aarch64"
Expand Down
4 changes: 0 additions & 4 deletions anoncred-kmm/anoncred-wrapper-rust/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,6 @@ val buildAnonCredWrapperForAndroidArch64 by tasks.register<Exec>("buildAnonCredW
"STRIP" to STRIP
)
this.environment = localEnv
println("Show all environment variables")
for (entry in this.environment.entries) {
println("${entry.key} : ${entry.value}")
}
inputs.files(fileTree(projectDir.resolve("src")))
outputs.files(fileTree(projectDir.resolve("target").resolve("aarch64-linux-android")))
commandLine("cargo", "ndk", "build", "--release", "--target", "aarch64-linux-android", "--target-dir", "${projectDir.resolve("target")}")
Expand Down
2 changes: 1 addition & 1 deletion uniffi/src/anoncreds.udl
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ interface Prover {
);

[Throws=AnoncredsError]
void process_credential(
Credential process_credential(
Credential credential,
CredentialRequestMetadata cred_request_metadata,
LinkSecret link_secret,
Expand Down
6 changes: 4 additions & 2 deletions uniffi/src/prover/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl Prover {
link_secret: Arc<LinkSecret>,
cred_def: Arc<CredentialDefinition>,
rev_reg_def: Option<Arc<RevocationRegistryDefinition>>,
) -> Result<(), AnoncredsError> {
) -> Result<Arc<Credential>, AnoncredsError> {
let mut mutable_credential = (*credential)
.core
.try_clone()
Expand All @@ -94,7 +94,9 @@ impl Prover {
&(*cred_def).core,
rev_reg_def.as_ref().map(|def| &(*def).core),
)
.map_err(|err| AnoncredsError::ProcessCredential(format!("Error: {}", err)))
.map_err(|err| AnoncredsError::ProcessCredential(format!("Error: {}", err)));

return Ok(Arc::new(Credential { core: mutable_credential }))
}

pub fn create_presentation(
Expand Down