Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bip32: bump bs58 to v0.5 #1139

Merged
merged 1 commit into from
May 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 19 additions & 56 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bip32/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ edition = "2021"
rust-version = "1.65"

[dependencies]
bs58 = { version = "0.4", default-features = false, features = ["check"] }
bs58 = { version = "0.5", default-features = false, features = ["check"] }
hmac = { version = "0.12", default-features = false }
rand_core = { version = "0.6", default-features = false }
ripemd = { version = "0.1", default-features = false }
Expand Down
4 changes: 2 additions & 2 deletions bip32/src/extended_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl ExtendedKey {
bytes[13..45].copy_from_slice(&self.attrs.chain_code);
bytes[45..78].copy_from_slice(&self.key_bytes);

let base58_len = bs58::encode(&bytes).with_check().into(buffer.as_mut())?;
let base58_len = bs58::encode(&bytes).with_check().onto(buffer.as_mut())?;
bytes.zeroize();

str::from_utf8(&buffer[..base58_len]).map_err(|_| Error::Base58)
Expand All @@ -70,7 +70,7 @@ impl FromStr for ExtendedKey {

fn from_str(base58: &str) -> Result<Self> {
let mut bytes = [0u8; Self::BYTE_SIZE + 4]; // with 4-byte checksum
let decoded_len = bs58::decode(base58).with_check(None).into(&mut bytes)?;
let decoded_len = bs58::decode(base58).with_check(None).onto(&mut bytes)?;

if decoded_len != Self::BYTE_SIZE {
return Err(Error::Decode);
Expand Down
2 changes: 1 addition & 1 deletion bip32/src/prefix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl Prefix {
bytes[..4].copy_from_slice(&version.to_be_bytes());

let mut buffer = [0u8; ExtendedKey::MAX_BASE58_SIZE];
bs58::encode(&bytes).with_check().into(buffer.as_mut())?;
bs58::encode(&bytes).with_check().onto(buffer.as_mut())?;

let s = str::from_utf8(&buffer[..4]).map_err(|_| Error::Base58)?;
Self::validate_str(s)?;
Expand Down