mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-01-05 23:03:06 +00:00
use tempdir for tests
This commit is contained in:
parent
6ed4369647
commit
a1d53ee6f0
@ -334,24 +334,20 @@ mod tests {
|
|||||||
use crate::config::AccountInitialData;
|
use crate::config::AccountInitialData;
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
use std::path::PathBuf;
|
|
||||||
|
|
||||||
use common::transaction::{SignaturePrivateKey, Transaction, TransactionBody, TxKind};
|
use common::transaction::{SignaturePrivateKey, Transaction, TransactionBody, TxKind};
|
||||||
use k256::{ecdsa::SigningKey, FieldBytes};
|
use k256::{ecdsa::SigningKey, FieldBytes};
|
||||||
use mempool_transaction::MempoolTransaction;
|
use mempool_transaction::MempoolTransaction;
|
||||||
use rand::Rng;
|
|
||||||
use secp256k1_zkp::Tweak;
|
use secp256k1_zkp::Tweak;
|
||||||
|
|
||||||
fn setup_sequencer_config_variable_initial_accounts(
|
fn setup_sequencer_config_variable_initial_accounts(
|
||||||
initial_accounts: Vec<AccountInitialData>,
|
initial_accounts: Vec<AccountInitialData>,
|
||||||
) -> SequencerConfig {
|
) -> SequencerConfig {
|
||||||
let mut rng = rand::thread_rng();
|
let tempdir = tempfile::tempdir().unwrap();
|
||||||
let random_u8: u8 = rng.gen();
|
let home = tempdir.path().to_path_buf();
|
||||||
|
|
||||||
let path_str = format!("/tmp/sequencer_{random_u8:?}");
|
|
||||||
|
|
||||||
SequencerConfig {
|
SequencerConfig {
|
||||||
home: PathBuf::from(path_str),
|
home,
|
||||||
override_rust_log: Some("info".to_string()),
|
override_rust_log: Some("info".to_string()),
|
||||||
genesis_id: 1,
|
genesis_id: 1,
|
||||||
is_genesis_random: false,
|
is_genesis_random: false,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user