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

[Integrity] Write helper to collectively return missing dependencies from must_get calls #3878

Open
jost-s opened this issue May 16, 2024 · 0 comments

Comments

@jost-s
Copy link
Contributor

jost-s commented May 16, 2024

A validation fn could look like this:

let entry = must_get_entry()?; // 1
check_if_entry_is_cool();
let action = must_get_action()?; // 2
check_if_action_is_cool();

If neither entry nor action are available locally, app validation will run once and get to 1, then return UnresolvedDependencies, wait 10 seconds, run again and get to 2, return UnresolvedDependencies, wait 10 seconds, run again and complete.

Instead an app dev could write:

let maybe_entry = must_get_entry();
let maybe_action = must_get_action();
let unresolved_dependencies = build_unresolved_dependencies_vector([maybe_entry, maybe_action]);
if unresolved_dependencies.len() > 1 {
  ValidateCallbackResult::UnresolvedDependencies(UnresolvedDependencies::Hashes(unresolved_dependencies))
} else {
  ValidateCallbackResult::Valid
}

AC:

  • Write a helper to handle the results of multiple must_gets, bundling missing hashes or agent activity together
  • possible interface:
let (entry, action) = resolve!(
  must_get_entry(hash1),
  must_get_action(hash2),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready
Development

No branches or pull requests

1 participant