From 5662beeb8afae5949df7cc4913dc6ea3cd933390 Mon Sep 17 00:00:00 2001 From: Luke Parker Date: Thu, 13 Nov 2025 05:25:41 -0500 Subject: [PATCH] Patch from `parity-bip39` back to `bip39` Per https://github.com/michalkucharczyk/rust-bip39/tree/mku-2.0.1-release, `parity-bip39` was a fork to publish a release of `bip39` with two specific PRs merged. Not only have those PRs been merged, yet `bip39` now accepts `bitcoin_hashes 0.14` (https://github.com/rust-bitcoin/rust-bip39/pull/76), making this a great time to reconcile (even though it does technically add a git dependency until the new release is cut...). --- Cargo.toml | 3 +++ deny.toml | 1 + patches/parity-bip39/Cargo.toml | 30 ++++++++++++++++++++++++++++++ patches/parity-bip39/src/lib.rs | 3 +++ 4 files changed, 37 insertions(+) create mode 100644 patches/parity-bip39/Cargo.toml create mode 100644 patches/parity-bip39/src/lib.rs diff --git a/Cargo.toml b/Cargo.toml index 688d6e98..3b978a3f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -201,6 +201,9 @@ lazy_static = { git = "https://github.com/rust-lang-nursery/lazy-static.rs", rev option-ext = { path = "patches/option-ext" } directories-next = { path = "patches/directories-next" } +# Patch from a fork back to upstream +parity-bip39 = { path = "patches/parity-bip39" } + # Patch to include `FromUniformBytes<64>` over `Scalar` k256 = { git = "https://github.com/kayabaNerve/elliptic-curves", rev = "4994c9ab163781a88cd4a49beae812a89a44e8c3" } p256 = { git = "https://github.com/kayabaNerve/elliptic-curves", rev = "4994c9ab163781a88cd4a49beae812a89a44e8c3" } diff --git a/deny.toml b/deny.toml index 4bc0837f..e28d5ffb 100644 --- a/deny.toml +++ b/deny.toml @@ -152,6 +152,7 @@ allow-git = [ "https://github.com/kayabaNerve/elliptic-curves", "https://github.com/monero-oxide/monero-oxide", "https://github.com/kayabaNerve/monero-oxide", + "https://github.com/rust-bitcoin/rust-bip39", "https://github.com/rust-rocksdb/rust-rocksdb", "https://github.com/serai-dex/patch-polkadot-sdk", ] diff --git a/patches/parity-bip39/Cargo.toml b/patches/parity-bip39/Cargo.toml new file mode 100644 index 00000000..3e444d8c --- /dev/null +++ b/patches/parity-bip39/Cargo.toml @@ -0,0 +1,30 @@ +[package] +name = "parity-bip39" +version = "2.99.99" +description = "Patch back to the upstream library" +license = "MIT" +repository = "https://github.com/serai-dex/serai/tree/develop/patches/parity-bip39" +authors = ["Luke Parker "] +keywords = [] +edition = "2021" + +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + +[workspace] + +[dependencies] +bip39 = { git = "https://github.com/rust-bitcoin/rust-bip39", commit = "f735e2559f30049f6738d1bf68c69a0b7bd7b858", default-features = false } + +[features] +default = ["bip39/default"] +alloc = ["bip39/alloc"] +std = ["bip39/std"] + +unicode-normalization = ["bip39/unicode-normalization"] +all-languages = ["bip39/all-languages"] + +zeroize = ["bip39/zeroize"] +rand_core = ["bip39/rand_core"] +rand = ["bip39/rand"] diff --git a/patches/parity-bip39/src/lib.rs b/patches/parity-bip39/src/lib.rs new file mode 100644 index 00000000..b9935270 --- /dev/null +++ b/patches/parity-bip39/src/lib.rs @@ -0,0 +1,3 @@ +#![cfg_attr(not(feature = "std"), no_std)] + +pub use bip39::*;