random string fix
This commit is contained in:
parent
3b0a64f199
commit
a7b43bbcd6
|
@ -15,5 +15,5 @@ clap = { version = "4.1.6", features = ["derive"] }
|
||||||
tokio = { version = "1.25.0", features = ["full", "fs"]}
|
tokio = { version = "1.25.0", features = ["full", "fs"]}
|
||||||
tracing-subscriber = "0.3.16"
|
tracing-subscriber = "0.3.16"
|
||||||
dirs = "4.0.0"
|
dirs = "4.0.0"
|
||||||
uuid = { version = "1.3.0", features = ["v4"] }
|
rand = "0.8.5"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
|
use rand::{distributions::Alphanumeric, prelude::Distribution};
|
||||||
use solana_rpc_client::nonblocking::rpc_client::RpcClient;
|
use solana_rpc_client::nonblocking::rpc_client::RpcClient;
|
||||||
use solana_sdk::{
|
use solana_sdk::{
|
||||||
commitment_config::CommitmentConfig,
|
commitment_config::CommitmentConfig,
|
||||||
|
@ -68,9 +69,13 @@ impl BenchHelper {
|
||||||
funded_payer: &Keypair,
|
funded_payer: &Keypair,
|
||||||
blockhash: Hash,
|
blockhash: Hash,
|
||||||
) -> Vec<Transaction> {
|
) -> Vec<Transaction> {
|
||||||
|
let random_bytes: Vec<u8> = Alphanumeric
|
||||||
|
.sample_iter(rand::thread_rng())
|
||||||
|
.take(10)
|
||||||
|
.collect();
|
||||||
|
|
||||||
(0..num_of_txs)
|
(0..num_of_txs)
|
||||||
.into_iter()
|
.map(|_| Self::create_memo_tx(&random_bytes, funded_payer, blockhash))
|
||||||
.map(|_| Self::create_memo_tx(uuid::Uuid::new_v4().as_bytes(), funded_payer, blockhash))
|
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue