diff --git a/crates/threshold-signature-server/Cargo.toml b/crates/threshold-signature-server/Cargo.toml index e1a299245..54bc9a5d3 100644 --- a/crates/threshold-signature-server/Cargo.toml +++ b/crates/threshold-signature-server/Cargo.toml @@ -38,6 +38,7 @@ axum ={ version="0.7.9", features=["ws"] } subxt ="0.35.3" parity-scale-codec="3.6.12" sp-core ={ version="31.0.0", default-features=false } +sp-keyring ="34.0.0" # Entropy entropy-shared ={ version="0.3.0", path="../shared" } @@ -79,7 +80,6 @@ configfs-tsm ={ version="0.0.1", optional=true } serial_test ="3.2.0" hex-literal ="0.4.1" project-root="0.2.2" -sp-keyring ="34.0.0" more-asserts="0.3.1" lazy_static ="1.5.0" blake3 ="1.5.5" diff --git a/crates/threshold-signature-server/src/helpers/tests.rs b/crates/threshold-signature-server/src/helpers/tests.rs index 759b923a4..9d647a20d 100644 --- a/crates/threshold-signature-server/src/helpers/tests.rs +++ b/crates/threshold-signature-server/src/helpers/tests.rs @@ -25,8 +25,8 @@ use crate::{ chain_api::{ entropy::{ self, - runtime_types::pallet_staking_extension::pallet::{JumpStartStatus, ServerInfo}, runtime_types::entropy_runtime::RuntimeCall, + runtime_types::pallet_staking_extension::pallet::{JumpStartStatus, ServerInfo}, }, EntropyConfig, }, @@ -49,14 +49,13 @@ use entropy_protocol::PartyId; #[cfg(test)] use entropy_shared::EncodedVerifyingKey; use entropy_shared::NETWORK_PARENT_KEY; +use sp_keyring::AccountKeyring; use std::{fmt, net::SocketAddr, str, time::Duration}; use subxt::{ - backend::legacy::LegacyRpcMethods, ext::sp_core::sr25519, tx::{PairSigner, TxPayload}, - utils::AccountId32 as SubxtAccountId32, Config, OnlineClient, config::PolkadotExtrinsicParamsBuilder as Params + backend::legacy::LegacyRpcMethods, ext::sp_core::sr25519, tx::PairSigner, + utils::AccountId32 as SubxtAccountId32, Config, OnlineClient, }; use tokio::sync::OnceCell; -#[cfg(test)] -use sp_keyring::AccountKeyring; /// A shared reference to the logger used for tests. /// @@ -374,8 +373,11 @@ pub fn get_port(server_info: &ServerInfo) -> u32 { socket_address.port().into() } -#[cfg(test)] -pub async fn call_set_storage(api: &OnlineClient, rpc: &LegacyRpcMethods, call: RuntimeCall) { +pub async fn call_set_storage( + api: &OnlineClient, + rpc: &LegacyRpcMethods, + call: RuntimeCall, +) { let set_storage = entropy::tx().sudo().sudo(call); let alice = AccountKeyring::Alice; diff --git a/crates/threshold-signature-server/src/validator/tests.rs b/crates/threshold-signature-server/src/validator/tests.rs index 79c851eb6..e47e28f70 100644 --- a/crates/threshold-signature-server/src/validator/tests.rs +++ b/crates/threshold-signature-server/src/validator/tests.rs @@ -29,13 +29,13 @@ use crate::{ use entropy_client::{self as test_client}; use entropy_client::{ chain_api::{ - entropy, entropy::runtime_types::bounded_collections::bounded_vec::BoundedVec, + entropy, + entropy::runtime_types::bounded_collections::bounded_vec::BoundedVec, entropy::runtime_types::entropy_runtime::RuntimeCall, - entropy::runtime_types::entropy_runtime::RuntimeCall::StakingExtension, entropy::runtime_types::frame_system::pallet::Call as SystemsCall, entropy::runtime_types::pallet_registry::pallet::ProgramInstance, - entropy::runtime_types::pallet_staking_extension::pallet::{ReshareInfo, NextSignerInfo}, get_api, get_rpc, - EntropyConfig, + entropy::runtime_types::pallet_staking_extension::pallet::{NextSignerInfo, ReshareInfo}, + get_api, get_rpc, }, substrate::query_chain, Hasher, @@ -55,7 +55,7 @@ use serial_test::serial; use sp_core::Pair; use sp_keyring::AccountKeyring; use std::collections::HashSet; -use subxt::{config::PolkadotExtrinsicParamsBuilder as Params, tx::PairSigner, utils::AccountId32}; +use subxt::utils::AccountId32; use synedrion::k256::ecdsa::VerifyingKey; #[tokio::test] @@ -74,7 +74,6 @@ async fn test_reshare_basic() { .await; let api = get_api(&context[0].ws_url).await.unwrap(); let rpc = get_rpc(&context[0].ws_url).await.unwrap(); - let alice = AccountKeyring::Alice; let alice_stash = AccountKeyring::AliceStash; let client = reqwest::Client::new(); @@ -191,9 +190,8 @@ async fn test_reshare_basic() { let block_number = rpc.chain_get_header(None).await.unwrap().unwrap().number + 2; let key_share_before_2 = unsafe_get(&client, hex::encode(NETWORK_PARENT_KEY), 3002).await; - let storage_address_next_signers = entropy::storage().staking_extension().next_signers(); - let value_next_signers = NextSignerInfo { confirmations: vec![], next_signers: next_signers }; + let value_next_signers = NextSignerInfo { confirmations: vec![], next_signers }; // Add another reshare let call = RuntimeCall::System(SystemsCall::set_storage { items: vec![(storage_address_next_signers.to_root_bytes(), value_next_signers.encode())], @@ -201,7 +199,8 @@ async fn test_reshare_basic() { call_set_storage(&api, &rpc, call).await; let storage_address_reshare_data = entropy::storage().staking_extension().reshare_data(); - let value_reshare_info = ReshareInfo { block_number, new_signers: vec![alice_stash.public().encode()] }; + let value_reshare_info = + ReshareInfo { block_number, new_signers: vec![alice_stash.public().encode()] }; // Add another reshare let call = RuntimeCall::System(SystemsCall::set_storage { items: vec![(storage_address_reshare_data.to_root_bytes(), value_reshare_info.encode())],