Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 2 additions & 0 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions frozen-abi-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,9 @@ fn quote_for_test(
quote! {
#[test]
fn test_abi_digest() {
use ::rand::{SeedableRng, RngCore};
use ::rand_chacha::ChaCha8Rng;
use ::bincode;
use ::solana_frozen_abi::rand::{SeedableRng, RngCore};
use ::solana_frozen_abi::rand_chacha::ChaCha8Rng;
use ::solana_frozen_abi::bincode;
use ::solana_frozen_abi::stable_abi::StableAbi;

let mut rng = ChaCha8Rng::seed_from_u64(20666175621446498);
Expand Down
7 changes: 6 additions & 1 deletion frozen-abi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,14 @@ solana-frozen-abi-macro = { workspace = true }
thiserror = { workspace = true }

[target.'cfg(not(target_os = "solana"))'.dependencies]
# This dependency is used only to back `frozen-abi` StableAbi API
bincode = "1.3.3"
im = { workspace = true, features = ["rayon", "serde"] }
memmap2 = { workspace = true }
rand = { workspace = true }
# These dependencies are used only to back `frozen-abi` StableAbi API,
# to avoid version skew and keep digest computation stable regardless of consumer dependencies.
rand = "0.8.5"
rand_chacha = "0.3.1"

[target.'cfg(not(target_os = "solana"))'.dev-dependencies]
bitflags = { workspace = true, features = ["serde"] }
Expand Down
10 changes: 10 additions & 0 deletions frozen-abi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ pub mod stable_abi;
#[macro_use]
extern crate solana_frozen_abi_macro;

#[cfg(feature = "frozen-abi")]
#[cfg(not(target_os = "solana"))]
pub use bincode;
#[cfg(feature = "frozen-abi")]
#[cfg(not(target_os = "solana"))]
pub use rand;
#[cfg(feature = "frozen-abi")]
#[cfg(not(target_os = "solana"))]
pub use rand_chacha;

// Not public API. Previously referenced by macro-generated code. Remove the
// `log` dependency from Cargo.toml when this is cleaned up in the next major
// version bump
Expand Down
2 changes: 1 addition & 1 deletion frozen-abi/src/stable_abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ pub trait StableAbi: Sized {
where
Standard: rand::distributions::Distribution<Self>,
{
rng.gen::<Self>()
rng.r#gen::<Self>()
}
}