Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(iota-genesis-builder): Make load from file deterministic for the UnsignedGenesis #5347

Merged
merged 5 commits into from
Feb 14, 2025
Merged
6 changes: 3 additions & 3 deletions crates/iota-config/src/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// SPDX-License-Identifier: Apache-2.0

use std::{
collections::HashMap,
collections::{BTreeMap, HashMap},
fs::File,
io::{BufReader, BufWriter},
path::Path,
Expand Down Expand Up @@ -668,7 +668,7 @@ pub struct Delegation {
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub struct Delegations {
pub allocations: HashMap<IotaAddress, Vec<ValidatorAllocation>>,
pub allocations: BTreeMap<IotaAddress, Vec<ValidatorAllocation>>,
}

impl Delegations {
Expand All @@ -685,7 +685,7 @@ impl Delegations {
})
.collect();

let mut allocations = HashMap::new();
let mut allocations = BTreeMap::new();
allocations.insert(delegator, validator_allocations);

Self { allocations }
Expand Down