Skip to content

Commit

Permalink
rs: Bump bitcoin dependency to 0.30.1 and re-publish
Browse files Browse the repository at this point in the history
  • Loading branch information
cdecker authored and vincenzopalazzo committed Sep 28, 2023
1 parent ac62396 commit bb483b8
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 62 deletions.
37 changes: 26 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions cln-grpc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cln-grpc"
version = "0.1.5"
version = "0.1.6"
edition = "2021"
license = "MIT"
description = "The Core Lightning API as grpc primitives. Provides the bindings used to expose the API over the network."
Expand All @@ -19,10 +19,11 @@ cln-rpc = { path="../cln-rpc/", version = "^0.1", optional = true }
tonic = { version = "0.8", features = ["tls", "transport"] }
prost = "0.11"
hex = "0.4.3"
bitcoin = { version = "0.29", features = [ "serde" ] }
bitcoin = { version = "0.30", features = [ "serde" ] }

[dev-dependencies]
serde_json = "1.0.72"
cln-rpc = { path="../cln-rpc/", version = "^0.1" }

[build-dependencies]
tonic-build = "0.8"
48 changes: 1 addition & 47 deletions cln-grpc/src/test.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use crate::pb::*;
use serde_json::json;

#[test]
Expand Down Expand Up @@ -247,57 +246,14 @@ fn test_getinfo() {
"network": "regtest",
"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::responses::GetinfoResponse = serde_json::from_value(j.clone()).unwrap();
let _g: GetinfoResponse = u.into();
let _u: cln_rpc::model::responses::GetinfoResponse = serde_json::from_value(j.clone()).unwrap();
//let u2: cln_rpc::model::GetinfoResponse = g.into();
//let j2 = serde_json::to_value(u2).unwrap();
//assert_eq!(j, j2);
}

#[test]
fn test_keysend() {
let g =
KeysendRequest {
destination: hex::decode(
"035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d",
)
.unwrap(),
amount_msat: Some(Amount { msat: 10000 }),

label: Some("hello".to_string()),
exemptfee: None,
maxdelay: None,
retry_for: None,
maxfeepercent: None,
routehints: Some(RoutehintList {
hints: vec![Routehint {
hops: vec![RouteHop {
id: hex::decode(
"035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d",
)
.unwrap(),
short_channel_id: "12345x678x90".to_string(),
feebase: Some(Amount { msat: 123 }),
feeprop: 1234,
expirydelta: 9,
},RouteHop {
id: hex::decode(
"035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d",
)
.unwrap(),
short_channel_id: "12345x678x90".to_string(),
feebase: Some(Amount { msat: 123 }),
feeprop: 1234,
expirydelta: 9,
}],
}],
}),
extratlvs: None,
};

let u: cln_rpc::model::requests::KeysendRequest = g.into();
let _ser = serde_json::to_string(&u);

let j = r#"{
"destination": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d",
"payment_hash": "e74b03a98453dcb5a7ed5406b97ec3566dde4be85ef71685110f4c0ebc600592",
Expand All @@ -311,8 +267,6 @@ fn test_keysend() {
"status": "complete"
}"#;
let u: cln_rpc::model::responses::KeysendResponse = serde_json::from_str(j).unwrap();
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::responses::KeysendResponse = u.into();
Expand Down
4 changes: 2 additions & 2 deletions cln-rpc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cln-rpc"
version = "0.1.5"
version = "0.1.6"
edition = "2021"
license = "MIT"
description = "An async RPC client for Core Lightning."
Expand All @@ -14,7 +14,7 @@ path = "examples/getinfo.rs"

[dependencies]
anyhow = "1.0"
bitcoin = { version = "0.29", features = [ "serde" ] }
bitcoin = { version = "0.30", features = [ "serde" ] }
bytes = "1"
futures-util = { version = "0.3", features = [ "sink" ] }
hex = "0.4.3"
Expand Down

0 comments on commit bb483b8

Please sign in to comment.