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

Allow empty web3networks when linking identities #2352

Merged
merged 3 commits into from
Dec 22, 2023

Conversation

Kailai-Wang
Copy link
Collaborator

Context

This is a workaround to reduce the encoded call size.

We allow the client to pass in empty web3networks when linking identities and restore it to full network types internally.
Please note set_user_shielding_key is not affected - the client still has to provide valid network types.

@Kailai-Wang Kailai-Wang self-assigned this Dec 22, 2023
Copy link
Contributor

@jonalvarezz jonalvarezz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet! thank you, Kai!

Identity::Substrate(..) => all_substrate_web3networks(),
Identity::Evm(..) => all_evm_web3networks(),
Identity::Bitcoin(..) => all_bitcoin_web3networks(),
_ => Vec::new(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't it throw here and panic?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally we don't panic inside pallet, it's better to return an error here - but since it's on staging, I didn't even bother adding another error type (which requires refreshment of sidechain metadata) as I know it's unreachable.

@Kailai-Wang Kailai-Wang merged commit 4b4991a into staging Dec 22, 2023
@Kailai-Wang Kailai-Wang deleted the workaround-encoded-call-size branch December 22, 2023 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants