B:BD[
3.104455] → [
3.104455:104711]
B:BD[
3.104711] → [
2.0:35]
∅:D[
2.35] → [
3.104757:105083]
B:BD[
3.104757] → [
3.104757:105083]
if let Some((pk, signature)) = sign_hash(&mut key_path, hash).await? {
let sig = toml::Value::try_from(vec![Signature {
public_key: pk,
timestamp: change.header.timestamp,
signature,
}])?;
let mut toml = toml::map::Map::new();
toml.insert("signatures".to_string(), sig);
change.unhashed = Some(toml.into());
let hash2 = repo.changes.save_change(&change).unwrap();
assert_eq!(hash2, hash);
match sign_hash(&mut key_path, hash).await? {
Some((pk, signature)) if !signature.is_empty() => {
let sig = toml::Value::try_from(vec![Signature {
public_key: pk,
timestamp: change.header.timestamp,
signature,
}])?;
let mut toml = toml::map::Map::new();
toml.insert("signatures".to_string(), sig);
change.unhashed = Some(toml.into());
let hash2 = repo.changes.save_change(&change).unwrap();
assert_eq!(hash2, hash);
}
_ => {
bail!("Could not sign the change");
}