Skip to content

Commit

Permalink
fix(iota-genesis-builder): address_swap_map_path becomes optional (#4490
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Dkwcs authored Dec 13, 2024
1 parent 18f998d commit 1520c91
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions crates/iota-genesis-builder/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ enum Snapshot {
long,
help = "Path to the address swap map file. This must be a CSV file with two columns, where an entry contains in the first column an IotaAddress present in the Hornet full-snapshot and in the second column an IotaAddress that will be used for the swap."
)]
address_swap_map_path: String,
address_swap_map_path: Option<String>,
#[clap(long, value_parser = clap::value_parser!(MigrationTargetNetwork), help = "Target network for migration")]
target_network: MigrationTargetNetwork,
},
Expand Down Expand Up @@ -84,7 +84,11 @@ fn main() -> Result<()> {
CoinType::Iota => scale_amount_for_iota(snapshot_parser.total_supply()?)?,
};

let address_swap_map = AddressSwapMap::from_csv(&address_swap_map_path)?;
let address_swap_map = if let Some(address_swap_map_path) = address_swap_map_path {
AddressSwapMap::from_csv(&address_swap_map_path)?
} else {
AddressSwapMap::default()
};
// Prepare the migration using the parser output stream
let migration = Migration::new(
snapshot_parser.target_milestone_timestamp(),
Expand Down

0 comments on commit 1520c91

Please sign in to comment.