| 44 | |
| 45 | |
| 46 | Option<Error> validate(const Index& index) |
| 47 | { |
| 48 | if (index.schemaversion() != 2) { |
| 49 | return Error( |
| 50 | "Incorrect 'schemaVersion': " + |
| 51 | stringify(index.schemaversion())); |
| 52 | } |
| 53 | |
| 54 | foreach (const ManifestDescriptor& manifest, index.manifests()) { |
| 55 | Option<Error> error = validateDigest(manifest.digest()); |
| 56 | if (error.isSome()) { |
| 57 | return Error( |
| 58 | "Failed to validate 'digest' of the 'manifest': " + error->message); |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | return None(); |
| 63 | } |
| 64 | |
| 65 | |
| 66 | Option<Error> validate(const Manifest& manifest) |
no test coverage detected