0

I developed substrate parachain with custom pallets. Actually I wanna add OCW functionality to one of my pallets. After I updated runtime code and added CreateSignedTransaction implementation I tried to build my code, but got this errors:

the function or associated item `execute_block` exists for struct `Executive<Runtime, Block<Header<u32, BlakeTwo256>, UncheckedExtrinsic<..., ..., ..., ...>>, ..., ..., ...>`, but its trait bounds were not satisfied

And same errors for initialize_block, apply_extrinsic... Also got this:

the trait bound `sp_runtime::generic::UncheckedExtrinsic<MultiAddress<sp_runtime::AccountId32, u32>, RuntimeCall, MultiSignature, (CheckNonZeroSender<Runtime>, CheckSpecVersion<Runtime>, CheckTxVersion<Runtime>, CheckGenesis<Runtime>, CheckEra<Runtime>, CheckNonce<Runtime>, CheckWeight<Runtime>, ChargeTransactionPayment<Runtime>)>: Checkable<ChainContext<Runtime>>` is not satisfied

I used default implementation of UncheckedExtrinsic like this:

pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;

What could be a problem?

Thanks in advance.

1 Answer 1

0

If you look at the impl Checkable for UncheckedExtrinsic, you can see that this impl block is only present if a specific list of where clauses are met. The error you are getting is telling you that one of these where clauses are not met.

An anecdotal way that I found useful in debugging such issues is this:

  • replace the entire implementation block of fn check(_) with todo!() or similar.
  • Now start removing the individual where clauses one by one and try re-compiling the code
  • The first time when removing a where clause makes your code compile, it means that one was the unmet one.

This should give you a good starting point to then debug further why this clause is not met.

4
  • Thanks. But, I don't have impl of Checkable directly in my code, I just use sp_runtime::generic::UncheckedExtrinsic that already have this impl. Should I do/check something else? Commented Mar 25 at 8:59
  • @ kianenigma Hi there! Do you have any ideas considering comment above? Thanks! Commented Mar 26 at 7:59
  • This impl is coming in from sp-runtime, you can use this technique to use a local version of this crate such that you can do your debugging: doc.rust-lang.org/cargo/reference/…
    – kianenigma
    Commented Mar 26 at 9:09
  • Thank you. It's really works. But currently I'm confused a bit, because when I used a local version and try to build - everything worked without any changes. I removed patch and tried to build again - also worked. What it can be? I think it's solved for now, but not clear for me - why? Commented Mar 27 at 8:26

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