MCPcopy Create free account
hub / github.com/dfinity/orbit / validate_summary

Function validate_summary

core/station/impl/src/models/request.rs:110–123  ·  view source on GitHub ↗
(summary: &Option<String>)

Source from the content-addressed store, hash-verified

108}
109
110fn validate_summary(summary: &Option<String>) -> ModelValidatorResult<RequestError> {
111 if let Some(summary) = summary {
112 if summary.len() > Request::MAX_SUMMARY_LEN as usize {
113 return Err(RequestError::ValidationError {
114 info: format!(
115 "Request summary length exceeds the maximum allowed: {}",
116 Request::MAX_SUMMARY_LEN
117 ),
118 });
119 }
120 }
121
122 Ok(())
123}
124
125fn validate_expiration_dt(expiration_dt: &Timestamp) -> ModelValidatorResult<RequestError> {
126 if *expiration_dt <= next_time() {

Callers 3

validateMethod · 0.85

Calls 1

lenMethod · 0.45

Tested by 2