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

Additional Key Handover Tests #3165

Merged
merged 5 commits into from
May 3, 2023
Merged

Additional Key Handover Tests #3165

merged 5 commits into from
May 3, 2023

Conversation

msgmaxim
Copy link
Contributor

@msgmaxim msgmaxim commented May 2, 2023

Closes #3041

(commit names are self-explanatory)

@msgmaxim msgmaxim requested a review from j4m1ef0rd May 2, 2023 04:45
@codecov
Copy link

codecov bot commented May 2, 2023

Codecov Report

Merging #3165 (69ffe9e) into main (fdca074) will increase coverage by 0.01%.
The diff coverage is 93.91%.

@@            Coverage Diff             @@
##             main    #3165      +/-   ##
==========================================
+ Coverage   68.52%   68.54%   +0.01%     
==========================================
  Files         314      314              
  Lines       48816    48858      +42     
  Branches    48816    48858      +42     
==========================================
+ Hits        33453    33488      +35     
- Misses      10603    10606       +3     
- Partials     4760     4764       +4     
Impacted Files Coverage Δ
engine/multisig/src/client/keygen/tests.rs 87.55% <93.91%> (-0.22%) ⬇️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

// Accounts (3), (4) and (5) will receive the key as the result of this ceremony.
// (Note that (3) appears in both sets.)
let new_set: BTreeSet<_> = all_account_ids.iter().skip(2).take(3).cloned().collect();
assert!(sharing_subset.is_subset(&original_set));

// Perform a regular keygen to generate initial keys:
let (initial_key, mut key_infos) = keygen::generate_key_data::<Scheme>(
original_set.clone().into_iter().collect(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
original_set.clone().into_iter().collect(),
original_set.clone(),

type Scheme = BtcSigning;
type Point = <Scheme as CryptoScheme>::Point;
type Scalar = <Point as ECPoint>::Scalar;
fn to_account_id_set<T: AsRef<[u8]>>(ids: T) -> BTreeSet<AccountId> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be worth moving this into helpers so we can use it in other places. Could make the ACCOUNT_IDS lazy_static use it.
The db tests could use it, but it will need to be outside of helpers so we can put it under the "test" feature flag. Maybe we need a "common_helpers" file.
We can do it in another PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, let me make another PR.

@msgmaxim msgmaxim merged commit 9d6f2b0 into main May 3, 2023
@msgmaxim msgmaxim deleted the test/new-handover-tests branch May 3, 2023 06:56
syan095 added a commit that referenced this pull request May 4, 2023
* origin/main:
  feat: witness XCallNative and XCallToken (#3171)
  Additional Key Handover Tests (#3165)
  refactor/chore: remove db migration from 0 to 1 (#3166)
  fix: use correct stage name for PubkeyShares0 PRO-259 (#3167)
  ci: add timeout to post-checks ⏳ (#3169)
  chore: parallel post-check and publish (#3168)
  fix: add missing features on dep in utils (#3164)
  Moved multisig to its own crate (#3147)
  Refactor/database (#3150)
  fix: correct addresses for localnets (#3162)
  refactor/scc (#3078)
  fix: remove cancel workflow (#3160)
  refactor: remove epoch authority count (#3154)
  chore: remove mentions of sui (#3158)
  fix: remove duplicate role check (#3157)
  chore: remove unused quickcheck dep (#3156)
  feat: refactor Chainflip trait (#3144)
  chore: remove unused CFE deps (#3152)

# Conflicts:
#	state-chain/pallets/cf-swapping/src/mock.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Additional Key Handover Tests
2 participants