3

I am using:

ethereum-type version = "0.12", codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"]}
scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }

And latest substrate-node-template of branch polkadot-v0.9.19. So I am trying to build the code , and for the above ethereum_types, getting WrapperTypeEncode error. Can you help me to resolve the above error?

Complete error list:

    the trait bound `ethereum_types::U256: WrapperTypeEncode` is not satisfied
   --> pallets/light-client/src/lib.rs:101:1
    |
101 | #[frame_support::pallet]
    | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `ethereum_types::U256`
    |
    = note: required because of the requirements on the impl of `parity_scale_codec::Encode` for `ethereum_types::U256`
note: required by a bound in `EncodeLike`
   --> .cargo/registry/src/github.com-1ecc6299db9ec823/parity-scale-codec-3.1.2/src/encode_like.rs:73:25
    |
73  | pub trait EncodeLike<T: Encode = Self>: Sized + Encode {}
    |                         ^^^^^^ required by this bound in `EncodeLike`
    = note: this error originates in the attribute macro `frame_support::pallet` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `ethereum_types::H256: WrapperTypeEncode` is not satisfied
   --> pallets/light-client/src/lib.rs:101:1
    |
101 | #[frame_support::pallet]
    | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `ethereum_types::H256`
    |
    = note: required because of the requirements on the impl of `parity_scale_codec::Encode` for `ethereum_types::H256`
note: required by a bound in `EncodeLike`
   --> .cargo/registry/src/github.com-1ecc6299db9ec823/parity-scale-codec-3.1.2/src/encode_like.rs:73:25
    |
73  | pub trait EncodeLike<T: Encode = Self>: Sized + Encode {}
    |                         ^^^^^^ required by this bound in `EncodeLike`
    = note: this error originates in the attribute macro `frame_support::pallet` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0277`.
warning: `pallet-eth-light-client` (lib) generated 7 warnings
error: could not compile `pallet-eth-light-client` due to 2 previous errors; 7 warnings emitted
2
  • Resolved after updating the version below two crates as ethereum = { version = "0.12", default-features = false, features = ["with-codec"] } ethereum-types = { version = "0.13.1", default-features = false, features = ["rlp", "codec"] }
    – Asmita
    May 11 at 12:19
  • can you please add this as the answer?
    – Bruno
    May 11 at 12:38

1 Answer 1

3

Resolved after updating the version below two crates as

ethereum = { version = "0.12", default-features = false, features = ["with-codec"] } 
ethereum-types = { version = "0.13.1", default-features = false, features = ["rlp", "codec"] }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.