From ce03887f752238c2f83ca9c5233b8d27732e79b0 Mon Sep 17 00:00:00 2001 From: Leonardo Custodio Date: Tue, 21 Nov 2023 03:27:39 -0300 Subject: [PATCH] [PLA-1438] Updating with the wrong derived wallet (#18) --- lib/src/jobs.rs | 52 ++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/lib/src/jobs.rs b/lib/src/jobs.rs index ae61a9c..5a9482f 100644 --- a/lib/src/jobs.rs +++ b/lib/src/jobs.rs @@ -350,15 +350,15 @@ pub fn create_job_pair( PollJob, SignProcessor, ChainConnector>, ) -where - T: subxt::Config::Signature as Verify>::Signer as IdentifyAccount>::AccountId> + Send + Sync, - ::AccountId: Display + Sync + Clone + 'static, - ::Address: std::fmt::Debug + Send, - T::Extrinsic: Send + Sync, - T::BlockNumber: Into, - T::Address: From, - T::Signature: From + subxt::sp_runtime::traits::Verify, - ::Signer: From, + where + T: subxt::Config::Signature as Verify>::Signer as IdentifyAccount>::AccountId> + Send + Sync, + ::AccountId: Display + Sync + Clone + 'static, + ::Address: std::fmt::Debug + Send, + T::Extrinsic: Send + Sync, + T::BlockNumber: Into, + T::Address: From, + T::Signature: From + subxt::sp_runtime::traits::Verify, + ::Signer: From, { let client = Arc::new(reqwest::Client::new()); create_job_pair_with_executor( @@ -384,18 +384,18 @@ pub(crate) fn create_job_pair_with_executor, SignProcessor, ) -where - T: subxt::Config::Signature as Verify>::Signer as IdentifyAccount>::AccountId>, - T: Send + Sync, - ::AccountId: Display + Sync + Clone + 'static, - ::Address: std::fmt::Debug + Send, - T::Extrinsic: Send + Sync, - T::BlockNumber: Into, - T::Address: From, - T::Signature: From + subxt::sp_runtime::traits::Verify, - ::Signer: From, - Client: RequestExecutor + Debug + Send + Sync + 'static, - ContextProvider: ContextDataProvider< + where + T: subxt::Config::Signature as Verify>::Signer as IdentifyAccount>::AccountId>, + T: Send + Sync, + ::AccountId: Display + Sync + Clone + 'static, + ::Address: std::fmt::Debug + Send, + T::Extrinsic: Send + Sync, + T::BlockNumber: Into, + T::Address: From, + T::Signature: From + subxt::sp_runtime::traits::Verify, + ::Signer: From, + Client: RequestExecutor + Debug + Send + Sync + 'static, + ContextProvider: ContextDataProvider< ContextData = EfinityContextData, AccountId = T::AccountId, Nonce = T::Index, @@ -404,7 +404,7 @@ where + Sync + 'static + Debug, - ChainConnection: ChainConn> + ChainConnection: ChainConn> + Send + Sync + Debug @@ -849,7 +849,6 @@ impl TryFrom for D .external_id .ok_or("No external id to derive the wallet")?; - println!("ExternalId: {:?}", external_id); Ok(Self { external_id, request_id: get_pending_wallets_requests.node.id, @@ -1008,6 +1007,7 @@ where .with_max_elapsed_time(Some(std::time::Duration::from_secs(120))) .build(); let hash = hex::encode(tx); + let request_body = UpdateTransaction::build_query(update_transaction::Variables { state: Some(update_transaction::TransactionState::BROADCAST), transaction_hash: Some(format!("0x{hash}")), @@ -1100,7 +1100,7 @@ where ) { if let Some(external_id) = external_id { // This has security implications beware - let wallet = wallet.derive(format!("//{external_id}").into(), None); + let wallet = wallet.derive(external_id.into(), None); match wallet { Err(e) => { tracing::error!( @@ -1124,7 +1124,7 @@ where ) -> Option { if let Some(external_id) = external_id { // This has security implications beware - let wallet = wallet.derive(format!("//{external_id}").into(), None); + let wallet = wallet.derive(external_id.into(), None); match wallet { Err(e) => { @@ -1271,7 +1271,7 @@ where // Conversion from query response to SignRequest impl TryFrom - for SignRequest +for SignRequest { type Error = Box;