Skip to content

Commit

Permalink
Misc fixes from rebasing
Browse files Browse the repository at this point in the history
  • Loading branch information
kayabaNerve committed Aug 14, 2023
1 parent de05489 commit 7099643
Show file tree
Hide file tree
Showing 9 changed files with 323 additions and 346 deletions.
4 changes: 2 additions & 2 deletions coordinator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ pub async fn handle_processors<D: Db, Pro: Processors, P: P2p>(
if id.attempt != 0 {
panic!("attempt wasn't 0");
}
let nonces = crate::tributary::scanner::dkg_confirmation_nonces(&key, &spec);
let nonces = crate::tributary::dkg_confirmation_nonces(&key, &spec);
Some(Transaction::DkgShares {
attempt: id.attempt,
sender_i: my_i,
Expand All @@ -478,7 +478,7 @@ pub async fn handle_processors<D: Db, Pro: Processors, P: P2p>(

// Tell the Tributary the key pair, get back the share for the MuSig signature
let mut txn = db.txn();
let share = crate::tributary::scanner::generated_key_pair::<D>(
let share = crate::tributary::generated_key_pair::<D>(
&mut txn,
&key,
&spec,
Expand Down
15 changes: 7 additions & 8 deletions coordinator/src/tests/tributary/dkg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ async fn dkg_test() {
let mut scanner_db = TributaryDb(MemDb::new());
let processors = MemProcessors::new();
// Uses a brand new channel since this channel won't be used within this test
handle_new_blocks::<_, _, LocalP2p>(
handle_new_blocks::<_, _, _, _, LocalP2p>(
&mut scanner_db,
key,
&mpsc::unbounded_channel().0,
Expand All @@ -108,7 +108,7 @@ async fn dkg_test() {
sleep(Duration::from_secs(Tributary::<MemDb, Transaction, LocalP2p>::block_time().into())).await;

// Verify the scanner emits a KeyGen::Commitments message
handle_new_blocks::<_, _, LocalP2p>(
handle_new_blocks::<_, _, _, _, LocalP2p>(
&mut scanner_db,
&keys[0],
&mpsc::unbounded_channel().0,
Expand Down Expand Up @@ -170,7 +170,7 @@ async fn dkg_test() {
attempt,
sender_i: Participant::new((k + 1).try_into().unwrap()).unwrap(),
shares,
confirmation_nonces: crate::tributary::scanner::dkg_confirmation_nonces(key, &spec),
confirmation_nonces: crate::tributary::dkg_confirmation_nonces(key, &spec),
signed: Transaction::empty_signed(),
};
tx.sign(&mut OsRng, spec.genesis(), key, 1);
Expand All @@ -186,7 +186,7 @@ async fn dkg_test() {
}

// With just 4 sets of shares, nothing should happen yet
handle_new_blocks::<_, _, LocalP2p>(
handle_new_blocks::<_, _, _, _, LocalP2p>(
&mut scanner_db,
&keys[0],
&mpsc::unbounded_channel().0,
Expand Down Expand Up @@ -227,7 +227,7 @@ async fn dkg_test() {
};

// Any scanner which has handled the prior blocks should only emit the new event
handle_new_blocks::<_, _, LocalP2p>(
handle_new_blocks::<_, _, _, _, LocalP2p>(
&mut scanner_db,
&keys[0],
&mpsc::unbounded_channel().0,
Expand Down Expand Up @@ -278,8 +278,7 @@ async fn dkg_test() {
// albeit poor
let mut txn = scanner_db.0.txn();
let share =
crate::tributary::scanner::generated_key_pair::<MemDb>(&mut txn, key, &spec, &key_pair)
.unwrap();
crate::tributary::generated_key_pair::<MemDb>(&mut txn, key, &spec, &key_pair).unwrap();
txn.commit();

let mut tx = Transaction::DkgConfirmed(attempt, share, Transaction::empty_signed());
Expand All @@ -295,7 +294,7 @@ async fn dkg_test() {
}

// The scanner should successfully try to publish a transaction with a validly signed signature
handle_new_blocks(
handle_new_blocks::<_, _, _, _, LocalP2p>(
&mut scanner_db,
&keys[0],
&mpsc::unbounded_channel().0,
Expand Down
Loading

0 comments on commit 7099643

Please sign in to comment.