From 5b737512b744c3361ba22c4631884f234931ec3e Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Wed, 27 Sep 2023 00:08:57 +0200 Subject: [PATCH] rs: Bump bitcoin dependency to 0.30.1 and re-publish --- Cargo.lock | 37 ++++++++++++++++++++++++---------- cln-grpc/Cargo.toml | 5 +++-- cln-grpc/src/test.rs | 48 +------------------------------------------- cln-rpc/Cargo.toml | 4 ++-- 4 files changed, 32 insertions(+), 62 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6307f8c1e6c1..9e24e0c72d6a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -160,22 +160,31 @@ checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" [[package]] name = "bitcoin" -version = "0.29.2" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0694ea59225b0c5f3cb405ff3f670e4828358ed26aec49dc352f730f0cb1a8a3" +checksum = "4e99ff7289b20a7385f66a0feda78af2fc119d28fb56aea8886a9cd0a4abdd75" dependencies = [ "bech32", + "bitcoin-private", "bitcoin_hashes", + "hex_lit", "secp256k1", "serde", ] +[[package]] +name = "bitcoin-private" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73290177011694f38ec25e165d0387ab7ea749a4b81cd4c80dae5988229f7a57" + [[package]] name = "bitcoin_hashes" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" +checksum = "5d7066118b13d4b20b23645932dfb3a81ce7e29f95726c2036fa33cd7b092501" dependencies = [ + "bitcoin-private", "serde", ] @@ -211,7 +220,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "cln-grpc" -version = "0.1.4" +version = "0.1.6" dependencies = [ "anyhow", "bitcoin", @@ -241,7 +250,7 @@ dependencies = [ [[package]] name = "cln-plugin" -version = "0.1.5" +version = "0.1.6" dependencies = [ "anyhow", "bytes", @@ -258,7 +267,7 @@ dependencies = [ [[package]] name = "cln-rpc" -version = "0.1.4" +version = "0.1.6" dependencies = [ "anyhow", "bitcoin", @@ -517,6 +526,12 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hex_lit" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3011d1213f159867b13cfd6ac92d2cd5f1345762c63be3554e84092d85a50bbd" + [[package]] name = "http" version = "0.2.9" @@ -1086,9 +1101,9 @@ dependencies = [ [[package]] name = "secp256k1" -version = "0.24.3" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b1629c9c557ef9b293568b338dddfc8208c98a18c59d722a9d53f859d9c9b62" +checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f" dependencies = [ "bitcoin_hashes", "secp256k1-sys", @@ -1097,9 +1112,9 @@ dependencies = [ [[package]] name = "secp256k1-sys" -version = "0.6.1" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83080e2c2fc1006e625be82e5d1eb6a43b7fd9578b617fcc55814daf286bba4b" +checksum = "70a129b9e9efbfb223753b9163c4ab3b13cff7fd9c7f010fbac25ab4099fa07e" dependencies = [ "cc", ] diff --git a/cln-grpc/Cargo.toml b/cln-grpc/Cargo.toml index f9de49292927..d1377d14de35 100644 --- a/cln-grpc/Cargo.toml +++ b/cln-grpc/Cargo.toml @@ -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." @@ -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" diff --git a/cln-grpc/src/test.rs b/cln-grpc/src/test.rs index 2b393a2b66f1..7ec8266bb937 100644 --- a/cln-grpc/src/test.rs +++ b/cln-grpc/src/test.rs @@ -1,4 +1,3 @@ -use crate::pb::*; use serde_json::json; #[test] @@ -247,8 +246,7 @@ 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); @@ -256,48 +254,6 @@ fn test_getinfo() { #[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", @@ -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(); diff --git a/cln-rpc/Cargo.toml b/cln-rpc/Cargo.toml index 896ebb645a58..29bf6af2436a 100644 --- a/cln-rpc/Cargo.toml +++ b/cln-rpc/Cargo.toml @@ -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." @@ -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"