Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
paulormart committed Dec 19, 2024
1 parent 22769e4 commit dfe6c48
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/onet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ use crate::matrix::{Matrix, UserID, MATRIX_SUBSCRIBERS_FILENAME};
use crate::records::EpochIndex;
use crate::report::Network;
use crate::runtimes::{
kusama,
paseo,
polkadot,
kusama, paseo, polkadot,
support::{ChainPrefix, ChainTokenSymbol, SupportedRuntime},
};
use log::{error, info, warn};
Expand Down
10 changes: 8 additions & 2 deletions src/records.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1944,8 +1944,7 @@ mod tests {
assert_eq!(pr.group(), Some(2));
assert_eq!(pr.peers(), vec![456, 789]);

let dr = DiscoveryRecord::with_authority_discovery_key([1; 32]);
records.insert(&account, authority_idx, [1; 32], ar, dr, Some(pr));
records.insert(&account, authority_idx, ar, Some(pr));

assert_eq!(records.get_authorities(None).is_some(), true);
assert_eq!(
Expand Down Expand Up @@ -1989,5 +1988,12 @@ mod tests {
assert_eq!(stats.core_assignments(), 2);
}
}

let dr: DiscoveryRecord = DiscoveryRecord::with_authority_discovery_key([0; 32]);
assert_eq!(dr.authority_discovery_key(), "0000000000000000000000000000000000000000000000000000000000000000");

records.set_discovery_record(authority_idx, dr);
assert_eq!(records.get_authority_record(authority_idx, None).is_some(), true);

}
}

0 comments on commit dfe6c48

Please sign in to comment.