Skip to content

Commit 765cd7c

Browse files
authored
pubkey: Update const dependencies (#205)
Update dependencies
1 parent d84197b commit 765cd7c

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

Cargo.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/pubkey/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ unexpected_cfgs = { level = "warn", check-cfg = [
1818

1919
[features]
2020
default = ["const"]
21-
const = ["dep:const-crypto"]
21+
const = ["dep:five8_const", "dep:sha2-const-stable"]
2222

2323
[dependencies]
24-
const-crypto = { version = "0.3.0", optional = true }
24+
five8_const = { workspace = true, optional = true }
25+
sha2-const-stable = { version = "0.1.0", optional = true }
2526
pinocchio = { workspace = true }

sdk/pubkey/src/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ pub mod reexport {
77
pub use pinocchio::pubkey::Pubkey;
88
}
99

10-
#[cfg(feature = "const")]
11-
use const_crypto::{bs58::decode_pubkey, sha2::Sha256};
1210
use core::mem::MaybeUninit;
11+
#[cfg(feature = "const")]
12+
pub use five8_const::decode_32_const;
1313
use pinocchio::pubkey::{Pubkey, MAX_SEEDS, PDA_MARKER};
1414
#[cfg(target_os = "solana")]
1515
use pinocchio::syscalls::sol_sha256;
16+
#[cfg(feature = "const")]
17+
use sha2_const_stable::Sha256;
1618

1719
/// Derive a [program address][pda] from the given seeds, optional bump and
1820
/// program id.
@@ -191,5 +193,5 @@ macro_rules! declare_id {
191193
#[cfg(feature = "const")]
192194
#[inline(always)]
193195
pub const fn from_str(value: &str) -> Pubkey {
194-
decode_pubkey(value)
196+
decode_32_const(value)
195197
}

0 commit comments

Comments
 (0)