| 243 | |
| 244 | #[test] |
| 245 | fn serialize_custom_msg_notification() { |
| 246 | let msg = CustomMsgNotification { |
| 247 | peer_id: PublicKey::from_str( |
| 248 | "0364aeb75519be29d1af7b8cc6232dbda9fdabb79b66e4e1f6a223750954db210b", |
| 249 | ) |
| 250 | .unwrap(), |
| 251 | payload: String::from("941746573749"), |
| 252 | }; |
| 253 | |
| 254 | let notification = Notification::CustomMsg(msg); |
| 255 | |
| 256 | assert_eq!( |
| 257 | serde_json::to_value(notification).unwrap(), |
| 258 | serde_json::json!( |
| 259 | { |
| 260 | "custommsg" : { |
| 261 | "peer_id" : "0364aeb75519be29d1af7b8cc6232dbda9fdabb79b66e4e1f6a223750954db210b", |
| 262 | "payload" : "941746573749" |
| 263 | } |
| 264 | } |
| 265 | ) |
| 266 | ); |
| 267 | } |
| 268 | |
| 269 | #[test] |
| 270 | fn serialize_block_added_notification() { |