Skip to content

Commit 46c00a7

Browse files
[bcr-ebill-core] remove bs58 and reuse bitcoin::base58
1 parent f948861 commit 46c00a7

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ members = [ "crates/bcr-ebill-web", "crates/bcr-ebill-core", "crates/bcr-ebill-a
44

55

66
[workspace.dependencies]
7-
bs58 = "0.5"
87
sha2 = { version = "0.10", default-features = false }
98
borsh = "1.5"
109
borsh-derive = "1.5"

crates/bcr-ebill-core/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ serde_repr.workspace = true
1515
chrono.workspace = true
1616
uuid.workspace = true
1717
log.workspace = true
18-
bs58.workspace = true
1918
sha2.workspace = true
2019
thiserror.workspace = true
2120
bitcoin.workspace = true

crates/bcr-ebill-core/src/util/mod.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,13 @@ pub fn sha256_hash(bytes: &[u8]) -> String {
2222
pub enum Error {
2323
/// Errors stemming base58 decoding
2424
#[error("Decode base58 error: {0}")]
25-
Base58(#[from] bs58::decode::Error),
25+
Base58(bitcoin::base58::InvalidCharacterError),
2626
}
2727

2828
pub fn base58_encode(bytes: &[u8]) -> String {
29-
bs58::encode(bytes).into_string()
29+
bitcoin::base58::encode(bytes)
3030
}
3131

3232
pub fn base58_decode(input: &str) -> std::result::Result<Vec<u8>, Error> {
33-
let result = bs58::decode(input).into_vec()?;
34-
Ok(result)
33+
bitcoin::base58::decode(input).map_err(Error::Base58)
3534
}

0 commit comments

Comments
 (0)