Signed files keep their signature a string for every YAML parser (#4)

Co-authored-by: Danny Kim <temeddix@gmail.com>
Co-committed-by: Danny Kim <temeddix@gmail.com>
This commit was merged in pull request #4.
This commit is contained in:
Danny Kim
2026-09-25 19:43:09 +00:00
committed by temeddix
parent 5d46485dad
commit 1d36760782
3 changed files with 115 additions and 3 deletions
+2
View File
@@ -79,6 +79,8 @@ mod tests {
.map_err(|_| ErrorCode::Internal)?;
assert!(signed.starts_with("---\ntitle: Notes\n"));
assert!(signed.ends_with("---\n# Notes\n\nHello\n"));
// YAML reads a bare 0x... as an integer, so the signature stays a string.
assert!(signed.contains("\nsignature: \"0x"));
let fields = read_signature(&signed).ok_or(ErrorCode::Internal)?;
assert_eq!(fields.signer, "laptop.alice.eth");
let key = parse_key(KEY).ok_or(ErrorCode::Internal)?;