From 9ebc99566f216195c5887a1fed1917263aa3c986 Mon Sep 17 00:00:00 2001 From: Antoni Spaanderman <56turtle56@gmail.com> Date: Wed, 1 May 2024 17:20:27 +0200 Subject: [PATCH 1/4] update bitcoin to 0.32.0 and bitcoincore-rpc to 0.19.0 (not released yet) --- Cargo.toml | 2 +- integration_tests/Cargo.toml | 4 ++-- integration_tests/src/main.rs | 2 +- src/message.rs | 6 +++--- src/sequence_message.rs | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d1c7ddc..92a50a6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ async = ["dep:async_zmq", "dep:futures-util"] [dependencies] async_zmq = { version = "0.4.0", optional = true } -bitcoin = "0.31.1" +bitcoin = "0.32.0" futures-util = { version = "0.3.28", optional = true } zmq = "0.10.0" zmq-sys = "0.12.0" diff --git a/integration_tests/Cargo.toml b/integration_tests/Cargo.toml index 92f9208..feae593 100644 --- a/integration_tests/Cargo.toml +++ b/integration_tests/Cargo.toml @@ -4,8 +4,8 @@ version = "1.0.0" edition = "2021" [dependencies] -bitcoin = "0.31.1" -bitcoincore-rpc = "0.18.0" +bitcoin = "0.32.0" +bitcoincore-rpc = { git = "https://github.com/tcharding/rust-bitcoincore-rpc.git", rev = "2ce36cc6874d3bfe024740e237e39656ec893d53" } bitcoincore-zmq = { path = "..", features = ["async"] } futures = "0.3.28" tokio = { version = "1.35.0", features = ["full"] } diff --git a/integration_tests/src/main.rs b/integration_tests/src/main.rs index b53cecf..4ea6757 100644 --- a/integration_tests/src/main.rs +++ b/integration_tests/src/main.rs @@ -69,7 +69,7 @@ fn test_hashtx(rpc: &Client) { match recv_timeout_2(&receiver) { (Message::Tx(tx, _), Message::HashTx(txid, _)) | (Message::HashTx(txid, _), Message::Tx(tx, _)) => { - assert_eq!(tx.txid(), txid); + assert_eq!(tx.compute_txid(), txid); } (msg1, msg2) => { panic!("invalid messages received: ({msg1}, {msg2})"); diff --git a/src/message.rs b/src/message.rs index e936b80..f38a728 100644 --- a/src/message.rs +++ b/src/message.rs @@ -181,7 +181,7 @@ impl fmt::Display for Message { Self::HashBlock(blockhash, seq) => write!(f, "HashBlock({blockhash}, sequence={seq})"), Self::HashTx(txid, seq) => write!(f, "HashTx({txid}, sequence={seq})"), Self::Block(block, seq) => write!(f, "Block({}, sequence={seq})", block.block_hash()), - Self::Tx(tx, seq) => write!(f, "Tx({}, sequence={seq})", tx.txid()), + Self::Tx(tx, seq) => write!(f, "Tx({}, sequence={seq})", tx.compute_txid()), Self::Sequence(sm, seq) => write!(f, "Sequence({sm}, sequence={seq})"), } } @@ -198,7 +198,7 @@ mod tests { let tx = &genesis_block.txdata[0]; let tx_bytes = serialize(tx); - let txid = tx.txid(); + let txid = tx.compute_txid(); let mut txid_bytes = txid.to_byte_array(); txid_bytes.reverse(); @@ -241,7 +241,7 @@ mod tests { fn test_deserialize_hashtx() { let genesis_block = genesis_block(Network::Bitcoin); - let txid = genesis_block.txdata[0].txid(); + let txid = genesis_block.txdata[0].compute_txid(); let mut txid_bytes = txid.to_byte_array(); txid_bytes.reverse(); diff --git a/src/sequence_message.rs b/src/sequence_message.rs index a052a6f..00e1da1 100644 --- a/src/sequence_message.rs +++ b/src/sequence_message.rs @@ -202,7 +202,7 @@ mod tests { let mut blockhash_bytes = blockhash.to_byte_array(); blockhash_bytes.reverse(); - let txid = genesis_block.txdata[0].txid(); + let txid = genesis_block.txdata[0].compute_txid(); let mut txid_bytes = txid.to_byte_array(); txid_bytes.reverse(); From 37d88ed66acfe47cdb4f3f834c6823384a8e34bf Mon Sep 17 00:00:00 2001 From: Antoni Spaanderman <56turtle56@gmail.com> Date: Wed, 1 May 2024 17:23:52 +0200 Subject: [PATCH 2/4] update all other dependencies to their latest versions --- Cargo.toml | 6 +++--- integration_tests/Cargo.toml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 92a50a6..9185e95 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,14 +15,14 @@ async = ["dep:async_zmq", "dep:futures-util"] [dependencies] async_zmq = { version = "0.4.0", optional = true } bitcoin = "0.32.0" -futures-util = { version = "0.3.28", optional = true } +futures-util = { version = "0.3.30", optional = true } zmq = "0.10.0" zmq-sys = "0.12.0" # dependencies used in examples [dev-dependencies] -futures = "0.3.28" -tokio = { version = "1.35.0", features = ["time", "rt-multi-thread", "macros"] } +futures = "0.3.30" +tokio = { version = "1.37.0", features = ["time", "rt-multi-thread", "macros"] } [[example]] name = "subscribe_async_timeout" diff --git a/integration_tests/Cargo.toml b/integration_tests/Cargo.toml index feae593..c397a29 100644 --- a/integration_tests/Cargo.toml +++ b/integration_tests/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" bitcoin = "0.32.0" bitcoincore-rpc = { git = "https://github.com/tcharding/rust-bitcoincore-rpc.git", rev = "2ce36cc6874d3bfe024740e237e39656ec893d53" } bitcoincore-zmq = { path = "..", features = ["async"] } -futures = "0.3.28" -tokio = { version = "1.35.0", features = ["full"] } +futures = "0.3.30" +tokio = { version = "1.37.0", features = ["full"] } From 36a3bb772263c282f5c13b4ac9a9c84d9a488c60 Mon Sep 17 00:00:00 2001 From: Antoni Spaanderman <56turtle56@gmail.com> Date: Wed, 1 May 2024 17:33:25 +0200 Subject: [PATCH 3/4] that pr has been merged and will be included in 0.19 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 25794f4..6bff6b9 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Integration tests use the latest version of the 5 most recent major Bitcoin Core TODO: - This README - SequenceMessage itest -- Easy addEventListener like functionality with help of the `getzmqnotifications` rpc (bitcoincore-rpc PR: [#295](https://github.com/rust-bitcoin/rust-bitcoincore-rpc/pull/295)) +- Easy addEventListener like functionality with help of the `getzmqnotifications` rpc - raw messages - zmq publisher - include source in message From 33ffa0819e861998db0aea984169141f1498530d Mon Sep 17 00:00:00 2001 From: Antoni Spaanderman <56turtle56@gmail.com> Date: Fri, 17 May 2024 23:31:26 +0200 Subject: [PATCH 4/4] use crates.io release of bitcoincore-rpc --- integration_tests/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_tests/Cargo.toml b/integration_tests/Cargo.toml index c397a29..72e855a 100644 --- a/integration_tests/Cargo.toml +++ b/integration_tests/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" [dependencies] bitcoin = "0.32.0" -bitcoincore-rpc = { git = "https://github.com/tcharding/rust-bitcoincore-rpc.git", rev = "2ce36cc6874d3bfe024740e237e39656ec893d53" } +bitcoincore-rpc = "0.19.0" bitcoincore-zmq = { path = "..", features = ["async"] } futures = "0.3.30" tokio = { version = "1.37.0", features = ["full"] }