deps: Remove bitcoin_hashes and use nostr::hashes re-export

Signed-off-by: Awiteb <a@4rs.nl>
This commit is contained in:
Awiteb
2025-06-30 11:10:13 +00:00
parent 6467bc3bb5
commit 55e5d86c03
7 changed files with 12 additions and 47 deletions

View File

@@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add `either@1.15.0` to the dependencies - by Awiteb - Add `either@1.15.0` to the dependencies - by Awiteb
- Update `nostr` to `0.42.2` - by Awiteb - Update `nostr` to `0.42.2` - by Awiteb
- Remove `bitcoin_hashes` and use `nostr::hashes` re-export - by Awiteb
### Fixed ### Fixed

39
Cargo.lock generated
View File

@@ -200,34 +200,19 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb" checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb"
[[package]]
name = "bitcoin-internals"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b854212e29b96c8f0fe04cab11d57586c8f3257de0d146c76cb3b42b3eb9118"
[[package]] [[package]]
name = "bitcoin-io" name = "bitcoin-io"
version = "0.1.3" version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b47c4ab7a93edb0c7198c5535ed9b52b63095f4e9b45279c6736cec4b856baf" checksum = "0b47c4ab7a93edb0c7198c5535ed9b52b63095f4e9b45279c6736cec4b856baf"
[[package]]
name = "bitcoin-io"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26792cd2bf245069a1c5acb06aa7ad7abe1de69b507c90b490bca81e0665d0ee"
dependencies = [
"bitcoin-internals 0.4.0",
]
[[package]] [[package]]
name = "bitcoin_hashes" name = "bitcoin_hashes"
version = "0.13.0" version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1930a4dabfebb8d7d9992db18ebe3ae2876f0a305fab206fd168df931ede293b" checksum = "1930a4dabfebb8d7d9992db18ebe3ae2876f0a305fab206fd168df931ede293b"
dependencies = [ dependencies = [
"bitcoin-internals 0.2.0", "bitcoin-internals",
"hex-conservative 0.1.2", "hex-conservative 0.1.2",
] ]
@@ -237,21 +222,11 @@ version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16" checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16"
dependencies = [ dependencies = [
"bitcoin-io 0.1.3", "bitcoin-io",
"hex-conservative 0.2.1", "hex-conservative 0.2.1",
"serde", "serde",
] ]
[[package]]
name = "bitcoin_hashes"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e5d09f16329cd545d7e6008b2c6b2af3a90bc678cf41ac3d2f6755943301b16"
dependencies = [
"bitcoin-io 0.2.0",
"hex-conservative 0.3.0",
]
[[package]] [[package]]
name = "bitflags" name = "bitflags"
version = "2.9.1" version = "2.9.1"
@@ -727,15 +702,6 @@ dependencies = [
"arrayvec", "arrayvec",
] ]
[[package]]
name = "hex-conservative"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4afe881d0527571892c4034822e59bb10c6c991cce6abe8199b6f5cf10766f55"
dependencies = [
"arrayvec",
]
[[package]] [[package]]
name = "hmac" name = "hmac"
version = "0.12.1" version = "0.12.1"
@@ -1115,7 +1081,6 @@ dependencies = [
name = "n34" name = "n34"
version = "0.2.0" version = "0.2.0"
dependencies = [ dependencies = [
"bitcoin_hashes 0.16.0",
"chrono", "chrono",
"clap", "clap",
"clap-verbosity-flag", "clap-verbosity-flag",

View File

@@ -12,7 +12,6 @@ categories = ["command-line-utilities"]
rust-version = "1.85.1" rust-version = "1.85.1"
[dependencies] [dependencies]
bitcoin_hashes = "0.16.0"
chrono = "0.4.41" chrono = "0.4.41"
clap = { version = "4.5.37", features = ["derive"] } clap = { version = "4.5.37", features = ["derive"] }
clap-verbosity-flag = { version = "3.0.2", default-features = false, features = [ clap-verbosity-flag = { version = "3.0.2", default-features = false, features = [

View File

@@ -14,8 +14,8 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://gnu.org/licenses/gpl-3.0.html>. // along with this program. If not, see <https://gnu.org/licenses/gpl-3.0.html>.
use bitcoin_hashes::Sha1;
use clap::Args; use clap::Args;
use nostr::hashes::sha1::Hash as Sha1Hash;
use super::PatchStatus; use super::PatchStatus;
use crate::{ use crate::{
@@ -40,7 +40,7 @@ pub struct ApplyArgs {
patch_id: NostrEvent, patch_id: NostrEvent,
/// The applied commits /// The applied commits
#[arg(num_args = 1..)] #[arg(num_args = 1..)]
applied_commits: Vec<Sha1>, applied_commits: Vec<Sha1Hash>,
} }
impl CommandRunner for ApplyArgs { impl CommandRunner for ApplyArgs {

View File

@@ -14,8 +14,8 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://gnu.org/licenses/gpl-3.0.html>. // along with this program. If not, see <https://gnu.org/licenses/gpl-3.0.html>.
use bitcoin_hashes::Sha1;
use clap::Args; use clap::Args;
use nostr::hashes::sha1::Hash as Sha1Hash;
use super::PatchStatus; use super::PatchStatus;
use crate::{ use crate::{
@@ -39,7 +39,7 @@ pub struct MergeArgs {
/// revision root /// revision root
patch_id: NostrEvent, patch_id: NostrEvent,
/// The merge commit id /// The merge commit id
merge_commit: Sha1, merge_commit: Sha1Hash,
} }
impl CommandRunner for MergeArgs { impl CommandRunner for MergeArgs {

View File

@@ -16,11 +16,11 @@
use std::{fs, str::FromStr}; use std::{fs, str::FromStr};
use bitcoin_hashes::Sha1;
use clap::Args; use clap::Args;
use futures::future; use futures::future;
use nostr::{ use nostr::{
event::{EventBuilder, EventId, Kind, Tag, TagKind, Tags, UnsignedEvent}, event::{EventBuilder, EventId, Kind, Tag, TagKind, Tags, UnsignedEvent},
hashes::sha1::Hash as Sha1Hash,
key::PublicKey, key::PublicKey,
nips::{nip01::Coordinate, nip10::Marker}, nips::{nip01::Coordinate, nip10::Marker},
types::RelayUrl, types::RelayUrl,
@@ -156,7 +156,7 @@ async fn make_patch_series(
original_patch: Option<EventId>, original_patch: Option<EventId>,
relay_hint: Option<RelayUrl>, relay_hint: Option<RelayUrl>,
repo_coordinates: Vec<Coordinate>, repo_coordinates: Vec<Coordinate>,
euc: &Sha1, euc: Option<&Sha1Hash>,
author_pkey: PublicKey, author_pkey: PublicKey,
) -> N34Result<(Vec<UnsignedEvent>, Vec<RelayUrl>)> { ) -> N34Result<(Vec<UnsignedEvent>, Vec<RelayUrl>)> {
let mut write_relays = Vec::new(); let mut write_relays = Vec::new();
@@ -207,7 +207,7 @@ async fn make_patch(
reply_to: Option<EventId>, reply_to: Option<EventId>,
write_relay: Option<&RelayUrl>, write_relay: Option<&RelayUrl>,
repo_coordinates: &[Coordinate], repo_coordinates: &[Coordinate],
euc: &Sha1, euc: Option<&Sha1Hash>,
author_pkey: PublicKey, author_pkey: PublicKey,
) -> (UnsignedEvent, Vec<RelayUrl>) { ) -> (UnsignedEvent, Vec<RelayUrl>) {
let content_details = client.parse_content(&patch.body).await; let content_details = client.parse_content(&patch.body).await;

View File

@@ -16,11 +16,11 @@
use std::iter; use std::iter;
use bitcoin_hashes::Sha1;
use either::Either; use either::Either;
use nostr::{ use nostr::{
event::{EventBuilder, Tag, TagKind}, event::{EventBuilder, Tag, TagKind},
filter::Filter, filter::Filter,
hashes::sha1::Hash as Sha1Hash,
nips::nip10::Marker, nips::nip10::Marker,
}; };
@@ -128,7 +128,7 @@ pub async fn patch_status_command(
patch_id: NostrEvent, patch_id: NostrEvent,
naddrs: Option<Vec<NaddrOrSet>>, naddrs: Option<Vec<NaddrOrSet>>,
new_status: PatchStatus, new_status: PatchStatus,
merge_or_applied_commits: Option<Either<Sha1, Vec<Sha1>>>, merge_or_applied_commits: Option<Either<Sha1Hash, Vec<Sha1Hash>>>,
check_fn: impl FnOnce(&PatchStatus) -> N34Result<()>, check_fn: impl FnOnce(&PatchStatus) -> N34Result<()>,
) -> N34Result<()> { ) -> N34Result<()> {
let user_pkey = options.pubkey().await?; let user_pkey = options.pubkey().await?;