Skip to content

Commit 0d9749d

Browse files
committed
feat(iota): add --faucet-object-count to start cmd
1 parent 72833a9 commit 0d9749d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

crates/iota/src/iota_commands.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,10 @@ pub enum IotaCommand {
206206
/// Defaults to `200000000000`(200 IOTA).
207207
#[arg(long)]
208208
faucet_amount: Option<u64>,
209+
/// Set the amount of objects the faucet will send for each request.
210+
/// Defaults to 5.
211+
#[arg(long)]
212+
faucet_object_count: Option<usize>,
209213
#[cfg(feature = "indexer")]
210214
#[command(flatten)]
211215
indexer_feature_args: IndexerFeatureArgs,
@@ -392,6 +396,7 @@ impl IotaCommand {
392396
force_regenesis,
393397
with_faucet,
394398
faucet_amount,
399+
faucet_object_count,
395400
#[cfg(feature = "indexer")]
396401
indexer_feature_args,
397402
fullnode_rpc_port,
@@ -408,6 +413,7 @@ impl IotaCommand {
408413
config_dir.clone(),
409414
with_faucet,
410415
faucet_amount,
416+
faucet_object_count,
411417
#[cfg(feature = "indexer")]
412418
indexer_feature_args,
413419
force_regenesis,
@@ -640,6 +646,7 @@ async fn start(
640646
config_dir: Option<PathBuf>,
641647
with_faucet: Option<String>,
642648
faucet_amount: Option<u64>,
649+
faucet_object_count: Option<usize>,
643650
#[cfg(feature = "indexer")] indexer_feature_args: IndexerFeatureArgs,
644651
force_regenesis: bool,
645652
epoch_duration_ms: Option<u64>,
@@ -911,7 +918,7 @@ async fn start(
911918
let config = FaucetConfig {
912919
host_ip,
913920
port: faucet_address.port(),
914-
num_coins: DEFAULT_FAUCET_NUM_COINS,
921+
num_coins: faucet_object_count.unwrap_or(DEFAULT_FAUCET_NUM_COINS),
915922
amount: faucet_amount.unwrap_or(DEFAULT_FAUCET_NANOS_AMOUNT),
916923
..Default::default()
917924
};

crates/iota/tests/cli_tests.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ async fn test_start() -> Result<(), anyhow::Error> {
162162
force_regenesis: false,
163163
with_faucet: None,
164164
faucet_amount: None,
165+
faucet_object_count: None,
165166
fullnode_rpc_port: 9000,
166167
committee_size: None,
167168
epoch_duration_ms: None,

0 commit comments

Comments
 (0)