Merge rust-bitcoin/rust-bitcoin#2504: base58: Use pub extern crate instead of module

9d688396c9 base58: Use pub extern crate instead of module (Tobin C. Harding)

Pull request description:

  We don't add any implementations to the `base58` types so we can just `pub extern` the crate instead of using a module and re-exporting.

ACKs for top commit:
  Kixunil:
    ACK 9d688396c9
  apoelstra:
    ACK 9d688396c9

Tree-SHA512: 521af0fd1ae365a6d060dd3c38fc18c1fb3a6c46adb7cba64e53128c7a898c766bcc603078b4cb8a3672df96559633495b23203a33147b5b4959b0c690ab7451
This commit is contained in:
Andrew Poelstra 2024-02-26 23:38:56 +00:00
commit 42e8f537e6
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
5 changed files with 4 additions and 9 deletions

View File

@ -7,7 +7,7 @@ use internals::write_err;
use crate::address::{Address, NetworkUnchecked}; use crate::address::{Address, NetworkUnchecked};
use crate::blockdata::script::{witness_program, witness_version}; use crate::blockdata::script::{witness_program, witness_version};
use crate::prelude::*; use crate::prelude::*;
use crate::{base58, Network}; use crate::Network;
/// Address error. /// Address error.
#[derive(Debug, Clone, PartialEq, Eq)] #[derive(Debug, Clone, PartialEq, Eq)]

View File

@ -36,7 +36,6 @@ use bech32::primitives::hrp::Hrp;
use hashes::{sha256, Hash, HashEngine}; use hashes::{sha256, Hash, HashEngine};
use secp256k1::{Secp256k1, Verification, XOnlyPublicKey}; use secp256k1::{Secp256k1, Verification, XOnlyPublicKey};
use crate::base58;
use crate::blockdata::constants::{ use crate::blockdata::constants::{
MAX_SCRIPT_ELEMENT_SIZE, PUBKEY_ADDRESS_PREFIX_MAIN, PUBKEY_ADDRESS_PREFIX_TEST, MAX_SCRIPT_ELEMENT_SIZE, PUBKEY_ADDRESS_PREFIX_MAIN, PUBKEY_ADDRESS_PREFIX_TEST,
SCRIPT_ADDRESS_PREFIX_MAIN, SCRIPT_ADDRESS_PREFIX_TEST, SCRIPT_ADDRESS_PREFIX_MAIN, SCRIPT_ADDRESS_PREFIX_TEST,

View File

@ -15,7 +15,6 @@ use internals::{impl_array_newtype, write_err};
use io::Write; use io::Write;
use secp256k1::{Secp256k1, XOnlyPublicKey}; use secp256k1::{Secp256k1, XOnlyPublicKey};
use crate::base58;
use crate::crypto::key::{CompressedPublicKey, Keypair, PrivateKey}; use crate::crypto::key::{CompressedPublicKey, Keypair, PrivateKey};
use crate::internal_macros::impl_bytes_newtype; use crate::internal_macros::impl_bytes_newtype;
use crate::prelude::*; use crate::prelude::*;

View File

@ -21,7 +21,6 @@ use crate::internal_macros::impl_asref_push_bytes;
use crate::network::NetworkKind; use crate::network::NetworkKind;
use crate::prelude::*; use crate::prelude::*;
use crate::taproot::{TapNodeHash, TapTweakHash}; use crate::taproot::{TapNodeHash, TapTweakHash};
use crate::base58;
#[rustfmt::skip] // Keep public re-exports separate. #[rustfmt::skip] // Keep public re-exports separate.
pub use secp256k1::{constants, Keypair, Parity, Secp256k1, Verification, XOnlyPublicKey}; pub use secp256k1::{constants, Keypair, Parity, Secp256k1, Verification, XOnlyPublicKey};

View File

@ -61,6 +61,9 @@ extern crate alloc;
/// Encodes and decodes base64 as bytes or utf8. /// Encodes and decodes base64 as bytes or utf8.
pub extern crate base64; pub extern crate base64;
/// Bitcoin base58 encoding and decoding.
pub extern crate base58;
/// Rust implementation of cryptographic hash function algorithms. /// Rust implementation of cryptographic hash function algorithms.
pub extern crate hashes; pub extern crate hashes;
@ -195,8 +198,3 @@ pub mod amount {
} }
} }
} }
pub mod base58 {
//! Bitcoin base58 encoding and decoding.
pub use base58::{decode, decode_check, encode, encode_check, encode_check_to_fmt, Error};
}