Skip to content

Commit

Permalink
🤖 cargo-fmt auto-update
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jul 8, 2024
1 parent 8509e5f commit fbe2cfb
Showing 1 changed file with 34 additions and 7 deletions.
41 changes: 34 additions & 7 deletions demos/vc_issuer/tests/issue_credential.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ use canister_tests::framework::{env, get_wasm_path, principal_1, test_principal,
use ic_cdk::api::management_canister::provisional::CanisterId;
use ic_response_verification::types::VerificationInfo;
use ic_response_verification::verify_request_response_pair;
use pocket_ic::{call_candid, call_candid_as};
use pocket_ic::{query_candid_as, CallError, PocketIc};
use internet_identity_interface::http_gateway::{HttpRequest, HttpResponse};
use internet_identity_interface::internet_identity::types::vc_mvp::{
GetIdAliasRequest, PrepareIdAliasRequest,
};
use internet_identity_interface::internet_identity::types::FrontendHostname;
use lazy_static::lazy_static;
use pocket_ic::{call_candid, call_candid_as};
use pocket_ic::{query_candid_as, CallError, PocketIc};
use serde_bytes::ByteBuf;
use std::collections::HashMap;
use std::path::PathBuf;
Expand Down Expand Up @@ -106,15 +106,21 @@ pub fn install_issuer(env: &PocketIc, init: &IssuerInit) -> CanisterId {
}

mod api {
use pocket_ic::common::rest::RawEffectivePrincipal;
use super::*;
use pocket_ic::common::rest::RawEffectivePrincipal;

pub fn configure(
env: &PocketIc,
canister_id: CanisterId,
config: &IssuerInit,
) -> Result<(), CallError> {
call_candid(env, canister_id, RawEffectivePrincipal::None,"configure", (config,))
call_candid(
env,
canister_id,
RawEffectivePrincipal::None,
"configure",
(config,),
)
}

pub fn vc_consent_message(
Expand Down Expand Up @@ -183,23 +189,44 @@ mod api {
canister_id: CanisterId,
employee_id: Principal,
) -> Result<String, CallError> {
call_candid(env, canister_id, RawEffectivePrincipal::None,"add_employee", (employee_id,)).map(|(x,)| x)
call_candid(
env,
canister_id,
RawEffectivePrincipal::None,
"add_employee",
(employee_id,),
)
.map(|(x,)| x)
}

pub fn add_graduate(
env: &PocketIc,
canister_id: CanisterId,
graduate_id: Principal,
) -> Result<String, CallError> {
call_candid(env, canister_id, RawEffectivePrincipal::None,"add_graduate", (graduate_id,)).map(|(x,)| x)
call_candid(
env,
canister_id,
RawEffectivePrincipal::None,
"add_graduate",
(graduate_id,),
)
.map(|(x,)| x)
}

pub fn add_adult(
env: &PocketIc,
canister_id: CanisterId,
adult_id: Principal,
) -> Result<String, CallError> {
call_candid(env, canister_id, RawEffectivePrincipal::None,"add_adult", (adult_id,)).map(|(x,)| x)
call_candid(
env,
canister_id,
RawEffectivePrincipal::None,
"add_adult",
(adult_id,),
)
.map(|(x,)| x)
}

pub fn prepare_credential(
Expand Down

0 comments on commit fbe2cfb

Please sign in to comment.