Skip to main content

validate_state_key

Function validate_state_key 

Source
pub fn validate_state_key(key: &str) -> Result<(), &'static str>
Expand description

Validates a state key. Returns Ok(()) if the key is safe, or an error message.

Rules:

  • Must not be empty
  • Must not exceed MAX_STATE_KEY_LEN bytes
  • Must not contain path separators (/, \) or ..
  • Must not contain null bytes