attMaterialToAction converts the attestation material to the action material
(m *v1.Attestation_Material)
| 293 | |
| 294 | // attMaterialToAction converts the attestation material to the action material |
| 295 | func attMaterialToAction(m *v1.Attestation_Material) (*AttestationStatusMaterial, error) { |
| 296 | res := &AttestationStatusMaterial{ |
| 297 | Material: &Material{ |
| 298 | Name: m.GetId(), |
| 299 | Type: m.GetMaterialType().String(), |
| 300 | Annotations: stateAnnotationToAction(m.Annotations), |
| 301 | }, |
| 302 | IsOutput: m.Output, |
| 303 | Required: m.Required, |
| 304 | } |
| 305 | |
| 306 | if err := setMaterialValue(m, res); err != nil { |
| 307 | return nil, fmt.Errorf("setting material value: %w", err) |
| 308 | } |
| 309 | |
| 310 | return res, nil |
| 311 | } |
| 312 | |
| 313 | func pbAnnotationsToAction(in []*pbc.Annotation) []*Annotation { |
| 314 | res := make([]*Annotation, 0, len(in)) |
no test coverage detected