From df32c849bb3f6b28aa63b18ecb93d7062fe37b12 Mon Sep 17 00:00:00 2001 From: Alekos Filini Date: Mon, 25 Jan 2021 15:13:45 -0500 Subject: [PATCH] Add a function to return the version of BDK at runtime --- CHANGELOG.md | 4 ++++ src/lib.rs | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b1108de..be596822 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Misc +#### Added +- Added a function to get the version of BDK at runtime + ## [v0.3.0] - [v0.2.0] ### Descriptor diff --git a/src/lib.rs b/src/lib.rs index 1712296e..c3ac1ac0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -265,3 +265,8 @@ pub use wallet::address_validator; pub use wallet::signer; pub use wallet::tx_builder::TxBuilder; pub use wallet::Wallet; + +/// Get the version of BDK at runtime +pub fn version() -> &'static str { + env!("CARGO_PKG_VERSION", "unknown") +}