diff --git a/crates/threshold-signature-server/src/user/tests.rs b/crates/threshold-signature-server/src/user/tests.rs index 7366c2fc5..111efb54f 100644 --- a/crates/threshold-signature-server/src/user/tests.rs +++ b/crates/threshold-signature-server/src/user/tests.rs @@ -29,7 +29,7 @@ use entropy_protocol::{ }; use entropy_shared::{ HashingAlgorithm, DAVE_VERIFYING_KEY, DEFAULT_VERIFYING_KEY_NOT_REGISTERED, DEVICE_KEY_HASH, - EVE_VERIFYING_KEY, NETWORK_PARENT_KEY, + NETWORK_PARENT_KEY, }; use entropy_testing_utils::{ chain_api::{ diff --git a/crates/threshold-signature-server/src/validator/tests.rs b/crates/threshold-signature-server/src/validator/tests.rs index 3bdefba2e..8b43d3a5b 100644 --- a/crates/threshold-signature-server/src/validator/tests.rs +++ b/crates/threshold-signature-server/src/validator/tests.rs @@ -114,7 +114,7 @@ async fn test_reshare() { let block_number = TEST_RESHARE_BLOCK_NUMBER; let onchain_reshare_request = - OcwMessageReshare { new_signer: new_signer.0.to_vec(), block_number }; + OcwMessageReshare { new_signers: vec![new_signer.0.to_vec()], block_number }; run_to_block(&rpc, block_number + 1).await; // Send the OCW message to all TS servers who don't have a chain node @@ -323,7 +323,8 @@ async fn test_reshare_validation_fail() { let kv = setup_client().await; let block_number = rpc.chain_get_header(None).await.unwrap().unwrap().number + 1; - let mut ocw_message = OcwMessageReshare { new_signer: dave.public().encode(), block_number }; + let mut ocw_message = + OcwMessageReshare { new_signers: vec![dave.public().encode()], block_number }; let err_stale_data = validate_new_reshare(&api, &rpc, &ocw_message, &kv).await.map_err(|e| e.to_string()); @@ -361,7 +362,8 @@ async fn test_reshare_validation_fail_not_in_reshare() { let kv = setup_client().await; let block_number = rpc.chain_get_header(None).await.unwrap().unwrap().number + 1; - let ocw_message = OcwMessageReshare { new_signer: alice.public().encode(), block_number }; + let ocw_message = + OcwMessageReshare { new_signers: vec![alice.public().encode()], block_number }; run_to_block(&rpc, block_number + 1).await; diff --git a/crates/threshold-signature-server/tests/register_sign_reshare_sign.rs b/crates/threshold-signature-server/tests/register_sign_reshare_sign.rs index 766448017..603db06cb 100644 --- a/crates/threshold-signature-server/tests/register_sign_reshare_sign.rs +++ b/crates/threshold-signature-server/tests/register_sign_reshare_sign.rs @@ -163,7 +163,7 @@ async fn do_reshare(api: &OnlineClient, rpc: &LegacyRpcMethods::put(NextSignerInfo { next_signers, confirmations: vec![] }); - let new_signers = self - .mock_signer_rotate - .clone() - .2 - .into_iter() - .map(|x| x.encode()) - .collect::>(); ReshareData::::put(ReshareInfo { // To give enough time for test_reshare setup block_number: TEST_RESHARE_BLOCK_NUMBER.into(), @@ -730,11 +727,10 @@ pub mod pallet { remove_indexs.push(i); } } - if remove_indexs.len() == 0 { + if remove_indexs.is_empty() { current_signers.remove(0); } else { let remove_indexs_reversed: Vec<_> = remove_indexs.iter().rev().collect(); - dbg!(remove_indexs_reversed.clone()); for remove_index in remove_indexs_reversed { current_signers.remove(*remove_index); } @@ -746,13 +742,10 @@ pub mod pallet { // grab a current signer to initiate value let mut next_signer_up = &validators[0].clone(); let mut index; - dbg!(current_signers.clone()); // loops to find signer in validator that is not already signer while current_signers.contains(next_signer_up) { - dbg!(current_signers.clone()); index = randomness.next_u32() % validators.len() as u32; next_signer_up = &validators[index as usize]; - dbg!(next_signer_up.clone()); count += 1; }