Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 4 additions & 3 deletions src/commands/start/usdfc_funding/usdfc_funding_step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use super::funding_operations::{self, check_mock_usdfc_balance, transfer_mock_us
use super::key_operations::get_user_private_key;
use crate::commands::start::step::{SetupContext, Step};
use crate::commands::start::usdfc_funding::key_operations::get_user_eth_address;
use crate::constants::USER_ACCOUNT_COUNT;
use crate::docker::containers::lotus_container_name;
use crate::docker::core::container_is_running;
use std::error::Error;
Expand Down Expand Up @@ -41,7 +42,7 @@ impl USDFCFundingStep {
let mut accounts_to_check = Vec::new();

// Add user accounts (base-1 numbering)
for user_num in 1..=3 {
for user_num in 1..=USER_ACCOUNT_COUNT {
let account_name = format!("USER_{}", user_num);
accounts_to_check.push((account_name, 100_000u64));
}
Expand Down Expand Up @@ -250,7 +251,7 @@ impl Step for USDFCFundingStep {
let mut token_transfers = Vec::new();

// Add user accounts (base-1 numbering)
for user_num in 1..=3 {
for user_num in 1..=USER_ACCOUNT_COUNT {
let account_name = format!("USER_{}", user_num);
let eth_address = get_user_eth_address(&account_name)?;
let amount_tokens = 100_000u64;
Expand Down Expand Up @@ -291,7 +292,7 @@ impl Step for USDFCFundingStep {
// Build list of accounts to verify
let mut accounts_to_verify = Vec::new();

for user_num in 1..=3 {
for user_num in 1..=USER_ACCOUNT_COUNT {
let account_name = format!("USER_{}", user_num);
accounts_to_verify.push((account_name, 100_000u64));
}
Expand Down
3 changes: 3 additions & 0 deletions src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ pub const PORT_CHECK_TIMEOUT_MS: u64 = 5000;
/// PDP Service Provider configuration
pub const MAX_PDP_SP_COUNT: usize = 5;

/// Number of user test accounts (USER_1, USER_2, USER_3)
pub const USER_ACCOUNT_COUNT: usize = 3;

/// Service configuration
pub const SERVICE_NAME: &str = "FOC DevNet Warm Storage";
pub const SERVICE_DESCRIPTION: &str = "Warm storage service for FOC local development network";
Expand Down
3 changes: 2 additions & 1 deletion src/external_api/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use std::path::Path;
use chrono::Utc;

use crate::commands::start::step::SetupContext;
use crate::constants::USER_ACCOUNT_COUNT;
use crate::crypto::derive_ethereum_key;
use crate::crypto::mnemonic::load_mnemonic;
use crate::external_api::{
Expand Down Expand Up @@ -55,7 +56,7 @@ fn build_users(ctx: &SetupContext) -> Result<Vec<UserInfo>, Box<dyn std::error::
let seed = mnemonic.to_seed("");

let mut users = Vec::new();
for i in 1..=3 {
for i in 1..=USER_ACCOUNT_COUNT {
let name = format!("USER_{}", i);
let user = build_single_user(ctx, &name, &seed)?;
users.push(user);
Expand Down