Closed Kailai-Wang closed 1 year ago
I can see why we want this, and I can see the problems.
However, we could move the trait implementation along - I don't see a no std issue, the trait implementation and the sgx-runtime have to work in the enclave, which they do. But I am uncertain if merging all in into one crate is the nice solution.
I'm also feeling reluctant to move all into one crate - looks like there's no easy way out. I'll close this issue, thanks!
Is it possible to make them an sgx-runtime type so that they are included in the sgx-metadata, which can be used to generate types for F/E usage (e.g. when they need to construct a trustedCall for direct invocation)?
Adding derived trait bounds (
TypeInfo
,MaxEncodeLen
) won't be an issue, the real problem is the dependency:ita-stf
depends onita-sgx-runtime
, if we introduce TrustedCall into the runtime,ita-sgx-runtime
would in turn depend onita-stf
again, which creates a cyclic dependency.Moving only the definition of those enums to a place both crates depend on, or simply to sgx-runtime won't work because of the orphan rule.
Moving trait impl along won't work because of no_std of runtime
Is there any other way to easily do it?