polkadot-evm / frontier

Ethereum compatibility layer for Substrate.
Apache License 2.0
573 stars 486 forks source link

fp-account: No function or associated item named `from_str` found for struct `H160` #1501

Open MohsenNz opened 2 months ago

MohsenNz commented 2 months ago

Description

A bug in fp-account in stable2407 branch.

Steps to Reproduce

Adding fp-account = { git = "https://github.com/polkadot-evm/frontier.git", branch = "stable2407", default-features = false } to your project dependencies. Then try to compile.

Environment

Logs, Errors or Screenshots

After adding fp-account = { git = "https://github.com/polkadot-evm/frontier.git", branch = "stable2407", default-features = false } to my project, I encountered this error:

  error[E0599]: no function or associated item named `from_str` found for struct `H160` in the current scope
    --> /home/mohsen/.cargo/git/checkouts/frontier-3fa7ec73eeffbe18/2e219e1/primitives/account/src/lib.rs:51:9
     |
  51 |         H160::from_str(s)
     |               ^^^^^^^^ function or associated item not found in `H160`
     |
  note: if you're trying to build a new `H160` consider using one of the following associated functions:
        H160::repeat_byte
        H160::zero
        H160::from_slice
    --> /home/mohsen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/primitive-types-0.12.2/src/lib.rs:55:1
     |
  55 | / construct_fixed_hash! {
  56 | |     /// Fixed-size uninterpreted hash type with 20 bytes (160 bits) size.
  57 | |     #[cfg_attr(feature = "scale-info", derive(TypeInfo))]
  58 | |     pub struct H160(20);
  59 | | }
     | |_^
     = note: this error originates in the macro `construct_fixed_hash` (in Nightly builds, run with -Z macro-backtrace for more info)

I was pinned all polkadot-skd dependencies to "stable2407" and the same for frontier dependencies.

It's a typical cargo.toml

Additional Information

Finally, after changing fp-account branch to the master the problem solved.

boundless-forest commented 2 months ago

because the stable2407 doesn't contain https://github.com/polkadot-evm/frontier/pull/1496