The current procedure of with the compile flag seems like a hack to me. To increase testability and remove the need to test with different feature flags we should do something like this:
pub trait pallet_teerex::Config {
// other stuff
/// type that can verify an IAS or an DCAP sgx remote attestation report
type VerifySGXReport: VerifySGXReport
}
struct SgxProductionVerifier;
impl VerifySGXReport for SgxProductionVerifier {
// implement the real checks
}
struct SgxMockVerifier;
impl VerifySGXReport for SgxMockVerifier {
// do the the stuff we currently do with `--features skip-ias-check`
}
Then, instead of having to test with different feature flags, we can run tests on both of our verifier structs, and if we want we can run tests on two mock runtimes, one with each verifier.
The current procedure of with the compile flag seems like a hack to me. To increase testability and remove the need to test with different feature flags we should do something like this:
Then, instead of having to test with different feature flags, we can run tests on both of our verifier structs, and if we want we can run tests on two mock runtimes, one with each verifier.