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

chore: support Display/FromStr for AccountId20 in no_std #1426

Merged
merged 2 commits into from
May 15, 2024

Conversation

yjhmelody
Copy link
Contributor

No description provided.

@yjhmelody yjhmelody requested a review from sorpaas as a code owner May 13, 2024 07:12
@boundless-forest boundless-forest merged commit f060da6 into polkadot-evm:master May 15, 2024
4 checks passed
#[derive(Encode, Decode, MaxEncodedLen, TypeInfo)]
pub struct AccountId20(pub [u8; 20]);

#[cfg(feature = "serde")]
impl_serde::impl_fixed_hash_serde!(AccountId20, 20);

#[cfg(feature = "std")]

Choose a reason for hiding this comment

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

This is not a correct change. H160::from_str implementation is only available in primitive-types (that sp-core re-exports) if fixed-hash/rustc-hex feature is enabled, which is in turn enabled by primitive-types/rustc-hex, which sp-core only enables when std feature is used.

As the result this can (and does) fail for downstream users unless feature unification accidentally enables fixed-hash/rustc-hex. This should either be reverted or sp-core needs to enable primitive-types/rustc-hex unconditionally.

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.

4 participants