Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Commit

Permalink
impl templates with tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sajjon committed Nov 30, 2024
1 parent 3919c6b commit 019e17e
Show file tree
Hide file tree
Showing 6 changed files with 627 additions and 55 deletions.
1 change: 0 additions & 1 deletion crates/rules/src/matrices/builder/matrix_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ pub type MatrixBuilder = AbstractMatrixBuilderOrBuilt<

pub type MatrixTemplate = AbstractMatrixBuilt<FactorSourceTemplate>;


// ==================
// ===== PUBLIC =====
// ==================
Expand Down
16 changes: 8 additions & 8 deletions crates/rules/src/matrices/builder/matrix_builder_unit_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1566,9 +1566,9 @@ mod shield_configs {
let mut sut = make();

// Primary
// TODO: Ask Matt about this, does he mean Threshold(1) or Override?
sut.add_factor_source_to_primary_override(FactorSourceID::sample_ledger())
sut.add_factor_source_to_primary_threshold(FactorSourceID::sample_ledger())
.unwrap();
sut.set_threshold(1).unwrap();

// Recovery
sut.add_factor_source_to_recovery_override(FactorSourceID::sample_ledger_other())
Expand All @@ -1585,9 +1585,9 @@ mod shield_configs {
built,
MatrixOfFactorSourceIds::with_roles(
RoleWithFactorSourceIds::primary_with_factors(
0,
[],
1,
[FactorSourceID::sample_ledger(),],
[],
),
RoleWithFactorSourceIds::recovery_with_factors([
FactorSourceID::sample_ledger_other(),
Expand All @@ -1606,9 +1606,9 @@ mod shield_configs {
let mut sut = make();

// Primary
// TODO: Ask Matt about this, does he mean Threshold(1) or Override?
sut.add_factor_source_to_primary_override(FactorSourceID::sample_device())
sut.add_factor_source_to_primary_threshold(FactorSourceID::sample_device())
.unwrap();
sut.set_threshold(1).unwrap();

// Recovery
sut.add_factor_source_to_recovery_override(FactorSourceID::sample_ledger())
Expand All @@ -1625,9 +1625,9 @@ mod shield_configs {
built,
MatrixOfFactorSourceIds::with_roles(
RoleWithFactorSourceIds::primary_with_factors(
0,
[],
1,
[FactorSourceID::sample_device(),],
[],
),
RoleWithFactorSourceIds::recovery_with_factors([
FactorSourceID::sample_ledger(),
Expand Down
Loading

0 comments on commit 019e17e

Please sign in to comment.