Skip to content

More flexible challenge code generation in tests #1073

@Kailai-Wang

Description

@Kailai-Wang

Context

The challenge code is always hardcoded when mockserver feature is activated: https://github.com/litentry/litentry-parachain/blob/c485920fbdc980fcf0a8aac1ace9011c6606c8d1/tee-worker/app-libs/stf/src/helpers.rs#L134-L141

This makes it impossible to test e.g. #981, where we want to explicitly check the update of challenge code.

We need to either:

  • remove the hardcoded challenge code, and make mockserver to read the challenge code live from the chain state
    or
  • still use hardcoded but make it different each time, e.g. calculated from some outside inputs (env/command line/....)

And generally I'm not a fan ofmockserver feature as it requires a re-compilation and makes the test switch between dev/staging hard. Can we somehow remove this feature and use unified codebase? E.g. fully controlled by command line or startup args for worker.


✔️ Please set appropriate labels and assignees if applicable.

Metadata

Metadata

Assignees

Labels

D1-featureA new feature, a piece of functionality that needs to be developedI3-highshould be completed within 5 working days

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions