Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce trait VerySgxReport and make it an associated type of the teerex pallet #153

Open
clangenb opened this issue Feb 7, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@clangenb
Copy link
Contributor

clangenb commented Feb 7, 2023

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.

@clangenb clangenb added the enhancement New feature or request label Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant