mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
cln-rpc: Test for serialization of block_added
This commit is contained in:
parent
d743cf253f
commit
6b34c722f3
@ -331,7 +331,7 @@ where
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use self::notifications::CustomMsgNotification;
|
||||
use self::notifications::{BlockAddedNotification, CustomMsgNotification};
|
||||
|
||||
use super::*;
|
||||
use crate::model::*;
|
||||
@ -578,4 +578,25 @@ mod test {
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn serialize_block_added_notification() {
|
||||
let block_added = BlockAddedNotification {
|
||||
hash : crate::primitives::Sha256::from_str("000000000000000000000acab8abe0c67a52ed7e5a90a19c64930ff11fa84eca").unwrap(),
|
||||
height : 830702
|
||||
};
|
||||
|
||||
let notification = Notification::BlockAdded(block_added);
|
||||
|
||||
assert_eq!(
|
||||
serde_json::to_value(notification).unwrap(),
|
||||
serde_json::json!({
|
||||
"block_added" : {
|
||||
"hash" : "000000000000000000000acab8abe0c67a52ed7e5a90a19c64930ff11fa84eca",
|
||||
"height" : 830702
|
||||
}
|
||||
})
|
||||
)
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user