Skip to content

Commit e9a2e73

Browse files
fmt
1 parent 66f7758 commit e9a2e73

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

ic-agent/src/agent/status.rs

+17-6
Original file line numberDiff line numberDiff line change
@@ -119,20 +119,31 @@ fn can_serialize_status_as_json_with_non_null() {
119119
Text("replica_health_status".to_string()),
120120
Text("healthy".to_string()),
121121
);
122-
map.insert(Text("certified_height".to_string()), serde_cbor::value::Value::Integer(654275));
122+
map.insert(
123+
Text("certified_height".to_string()),
124+
serde_cbor::value::Value::Integer(654275),
125+
);
123126
map.insert(
124127
Text("arbitrary".to_string()),
125128
serde_cbor::value::Value::Null,
126129
);
127-
map.insert(Text("root_key".to_string()), serde_cbor::value::Value::Bytes(vec![1, 2, 3, 4]));
128-
map.insert(Text("truthy".to_string()), serde_cbor::value::Value::Bool(true));
130+
map.insert(
131+
Text("root_key".to_string()),
132+
serde_cbor::value::Value::Bytes(vec![1, 2, 3, 4]),
133+
);
134+
map.insert(
135+
Text("truthy".to_string()),
136+
serde_cbor::value::Value::Bool(true),
137+
);
129138
let mut submap = BTreeMap::new();
130139
submap.insert(Text("foo".to_string()), Text("bar".to_string()));
131-
map.insert(Text("submap".to_string()), serde_cbor::value::Value::Map(submap));
140+
map.insert(
141+
Text("submap".to_string()),
142+
serde_cbor::value::Value::Map(submap),
143+
);
132144
let cbor = serde_cbor::Value::Map(map);
133145
let status = Status::try_from(&cbor).expect("Failed to convert from cbor");
134-
let expected_json =
135-
r#"{"arbitrary":null,"certified_height":654275,"impl_version":"0.19.2","replica_health_status":"healthy","root_key":[1,2,3,4],"submap":{"foo":"bar"},"truthy":true}"#;
146+
let expected_json = r#"{"arbitrary":null,"certified_height":654275,"impl_version":"0.19.2","replica_health_status":"healthy","root_key":[1,2,3,4],"submap":{"foo":"bar"},"truthy":true}"#;
136147
let actual_json = serde_json::to_string(&status).expect("Failed to serialize as JSON");
137148
assert_eq!(expected_json, actual_json);
138149
}

0 commit comments

Comments
 (0)