Skip to content

Commit c6edb7f

Browse files
build(deps): bump rand from 0.8.5 to 0.9.1 (#82)
* build(deps): bump rand from 0.8.5 to 0.9.1 Bumps [rand](https://github.com/rust-random/rand) from 0.8.5 to 0.9.1. - [Release notes](https://github.com/rust-random/rand/releases) - [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md) - [Commits](rust-random/rand@0.8.5...rand_core-0.9.1) --- updated-dependencies: - dependency-name: rand dependency-version: 0.9.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Use rand 0.9 correctly --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jon C <me@jonc.dev>
1 parent d18db33 commit c6edb7f

File tree

3 files changed

+49
-15
lines changed

3 files changed

+49
-15
lines changed

Cargo.lock

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

generic-token-tests/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ license = "Apache-2.0"
1212
edition = "2021"
1313

1414
[dev-dependencies]
15-
rand = "0.8.0"
15+
rand = "0.9.1"
1616
spl-generic-token = { path = "../generic-token" }
1717
spl-token = "8.0.0"
1818
spl-token-2022 = "8.0.0"

generic-token-tests/tests/test_generic_token.rs

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,26 @@ fn test_get_packed_len() {
1919
}
2020

2121
fn random_token_account() -> SplAccount {
22-
let mut rng = thread_rng();
22+
let mut rng = rand::rng();
2323

2424
let mint = solana_pubkey::new_rand();
2525
let owner = solana_pubkey::new_rand();
26-
let amount = rng.gen();
27-
let delegate = if rng.gen() {
26+
let amount = rng.random();
27+
let delegate = if rng.random() {
2828
Some(solana_pubkey::new_rand())
2929
} else {
3030
None
3131
}
3232
.into();
33-
let state = rng.gen_range(0..3).try_into().unwrap();
34-
let is_native = rng.gen::<Option<u64>>().into();
35-
let delegated_amount = rng.gen();
36-
let close_authority = if rng.gen() {
33+
let state = rng.random_range(0..3).try_into().unwrap();
34+
let is_native = if rng.random() {
35+
Some(rng.random())
36+
} else {
37+
None
38+
}
39+
.into();
40+
let delegated_amount = rng.random();
41+
let close_authority = if rng.random() {
3742
Some(solana_pubkey::new_rand())
3843
} else {
3944
None
@@ -136,18 +141,18 @@ fn test_generic_account(is_token_2022_account: bool) {
136141
}
137142

138143
fn random_mint() -> SplMint {
139-
let mut rng = thread_rng();
144+
let mut rng = rand::rng();
140145

141-
let mint_authority = if rng.gen() {
146+
let mint_authority = if rng.random() {
142147
Some(solana_pubkey::new_rand())
143148
} else {
144149
None
145150
}
146151
.into();
147-
let supply = rng.gen();
148-
let decimals = rng.gen();
149-
let is_initialized = rng.gen();
150-
let freeze_authority = if rng.gen() {
152+
let supply = rng.random();
153+
let decimals = rng.random();
154+
let is_initialized = rng.random();
155+
let freeze_authority = if rng.random() {
151156
Some(solana_pubkey::new_rand())
152157
} else {
153158
None

0 commit comments

Comments
 (0)