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

Move the check logic of user-shielding-key-set into pallet #1471

Closed
Kailai-Wang opened this issue Mar 15, 2023 · 0 comments · Fixed by #1479
Closed

Move the check logic of user-shielding-key-set into pallet #1471

Kailai-Wang opened this issue Mar 15, 2023 · 0 comments · Fixed by #1479
Assignees
Labels
D2-bug Something isn't working I3-high should be completed within 5 working days

Comments

@Kailai-Wang
Copy link
Collaborator

Context

Imagine a user calls create_identity without setting up the shielding key, F/E will get the error "InvallidUserShieldingKey", but the identities are already created in the sidechain

This is because we execute the pallet logic first and don't check the shielding key until we want to send back the result later:

match Self::create_identity_runtime(
enclave_account,
who.clone(),
identity.clone(),
metadata,
bn,
parent_ss58_prefix,
) {
Ok(code) => {
debug!("create_identity_runtime {} OK", account_id_to_string(&who));
if let Some(key) = IdentityManagement::user_shielding_keys(&who) {

This is obviously incorrect. We should move the shielding key check either into the pallet or before the pallet call. I prefer the former solution.

related:


✔️ Please set appropriate labels and assignees if applicable.

@Kailai-Wang Kailai-Wang added D2-bug Something isn't working I3-high should be completed within 5 working days labels Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D2-bug Something isn't working I3-high should be completed within 5 working days
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants