diff --git a/cln-grpc/src/test.rs b/cln-grpc/src/test.rs index 4aa33c472dfa..4ab61d8306cd 100644 --- a/cln-grpc/src/test.rs +++ b/cln-grpc/src/test.rs @@ -218,8 +218,13 @@ fn test_listpeers() { } ] }); - let u: cln_rpc::model::ListpeersResponse = serde_json::from_value(j).unwrap(); - let _: ListpeersResponse = u.into(); + let u: cln_rpc::model::ListpeersResponse = serde_json::from_value(j.clone()).unwrap(); + let l: ListpeersResponse = u.into(); + let u2: cln_rpc::model::ListpeersResponse = l.into(); + let j2 = serde_json::to_value(u2).unwrap(); + println!("{}", j); + println!("{}", j2); + // assert_eq!(j, j2); // 40 diffs } #[test] @@ -240,8 +245,13 @@ fn test_getinfo() { "msatoshi_fees_collected": 0, "fees_collected_msat": "0msat", "lightning-dir": "/tmp/ltests-20irp76f/test_pay_variants_1/lightning-1/regtest", "our_features": {"init": "8808226aa2", "node": "80008808226aa2", "channel": "", "invoice": "024200"}}); - let u: cln_rpc::model::GetinfoResponse = serde_json::from_value(j).unwrap(); - let _g: GetinfoResponse = u.into(); + let u: cln_rpc::model::GetinfoResponse = serde_json::from_value(j.clone()).unwrap(); + let g: GetinfoResponse = u.into(); + let u2: cln_rpc::model::GetinfoResponse = g.into(); + let j2 = serde_json::to_value(u2).unwrap(); + println!("{}", j); + println!("{}", j2); + // assert_eq!(j, j2); // lighting-dir != lighting_dir } #[test] @@ -301,6 +311,11 @@ fn test_keysend() { "status": "complete" }"#; let u: cln_rpc::model::KeysendResponse = serde_json::from_str(j).unwrap(); - let g: KeysendResponse = u.into(); + let g: KeysendResponse = u.clone().into(); println!("{:?}", g); + + let v: serde_json::Value = serde_json::to_value(u.clone()).unwrap(); + let g: cln_rpc::model::KeysendResponse = u.into(); + let v2 = serde_json::to_value(g).unwrap(); + assert_eq!(v, v2); }