From 06be3f0bcfc006850c0f9f4145bfbc5895d6ab43 Mon Sep 17 00:00:00 2001 From: Hamish Peebles Date: Tue, 23 Jul 2024 10:34:57 +0100 Subject: [PATCH 1/2] Add `user_ii_principal` to `submit_proof_of_unique_personhood` args --- backend/canisters/user_index/api/can.did | 1 + .../api/src/updates/submit_proof_of_unique_personhood.rs | 3 ++- .../impl/src/updates/submit_proof_of_unique_personhood.rs | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/canisters/user_index/api/can.did b/backend/canisters/user_index/api/can.did index 7a13b861a3..c74a9ffc6d 100644 --- a/backend/canisters/user_index/api/can.did +++ b/backend/canisters/user_index/api/can.did @@ -266,6 +266,7 @@ type PayForDiamondMembershipResponse = variant { }; type SubmitProofOfUniquePersonhoodArgs = record { + user_ii_principal : principal; credential_jwt : text; }; diff --git a/backend/canisters/user_index/api/src/updates/submit_proof_of_unique_personhood.rs b/backend/canisters/user_index/api/src/updates/submit_proof_of_unique_personhood.rs index 45a226f7cb..a77c490756 100644 --- a/backend/canisters/user_index/api/src/updates/submit_proof_of_unique_personhood.rs +++ b/backend/canisters/user_index/api/src/updates/submit_proof_of_unique_personhood.rs @@ -1,8 +1,9 @@ -use candid::CandidType; +use candid::{CandidType, Principal}; use serde::{Deserialize, Serialize}; #[derive(CandidType, Serialize, Deserialize, Clone, Debug)] pub struct Args { + pub user_ii_principal: Principal, pub credential_jwt: String, } diff --git a/backend/canisters/user_index/impl/src/updates/submit_proof_of_unique_personhood.rs b/backend/canisters/user_index/impl/src/updates/submit_proof_of_unique_personhood.rs index 4129973c6b..f9281b04c4 100644 --- a/backend/canisters/user_index/impl/src/updates/submit_proof_of_unique_personhood.rs +++ b/backend/canisters/user_index/impl/src/updates/submit_proof_of_unique_personhood.rs @@ -21,7 +21,7 @@ fn submit_proof_of_unique_personhood_impl(args: Args, state: &mut RuntimeState) let now = state.env.now(); match verify_proof_of_unique_personhood( - caller, + args.user_ii_principal, state.data.internet_identity_canister_id, &args.credential_jwt, &state.data.ic_root_key, From 94ff2c18c060eaeb42a284232b43ebc0b6dff656 Mon Sep 17 00:00:00 2001 From: Hamish Peebles Date: Tue, 23 Jul 2024 10:35:59 +0100 Subject: [PATCH 2/2] Update CHANGELOG --- backend/canisters/user_index/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/canisters/user_index/CHANGELOG.md b/backend/canisters/user_index/CHANGELOG.md index 4e47d9b49d..706c7f203f 100644 --- a/backend/canisters/user_index/CHANGELOG.md +++ b/backend/canisters/user_index/CHANGELOG.md @@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Handle transfer fee changing in either direction ([#6064](https://github.com/open-chat-labs/open-chat/pull/6064)) - Accept proofs of uniqueness from LocalUserIndexes ([#6068](https://github.com/open-chat-labs/open-chat/pull/6068)) - Ensure UserIndex is only controller before installing LocalUserIndex ([#6070](https://github.com/open-chat-labs/open-chat/pull/6070)) +- Add `user_ii_principal` to `submit_proof_of_unique_personhood` args ([#6092](https://github.com/open-chat-labs/open-chat/pull/6092)) ### Removed