mirror of
https://github.com/aljazceru/cdk.git
synced 2025-12-25 08:35:09 +01:00
mint error test
This commit is contained in:
@@ -287,3 +287,23 @@ impl Client {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_decode_error() {
|
||||
let err = r#"{"code":0,"error":"Lightning invoice not paid yet."}"#;
|
||||
|
||||
let error = Error::from_json(err).unwrap();
|
||||
|
||||
match error {
|
||||
Error::InvoiceNotPaid => {}
|
||||
_ => panic!("Wrong error"),
|
||||
}
|
||||
|
||||
// assert_eq!(error, Error::InvoiceNotPaid);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user