Skip to content

Commit

Permalink
Fix clippy.
Browse files Browse the repository at this point in the history
  • Loading branch information
dvc94ch authored and haider-rs committed Feb 17, 2025
1 parent e66bb3c commit 0d65aef
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions tc-subxt/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,13 +342,11 @@ where
for extrinsic in extrinsics.into_iter() {
let extrinsic_hash = extrinsic.hash();
let front = self.pending_tx.front().map(|tx| tx.data.hash);
tracing::info!("pending tx {front:?} finalized tx {extrinsic_hash}");
if Some(extrinsic_hash) == self.pending_tx.front().map(|tx| tx.data.hash) {
if Some(extrinsic_hash) == front {
let Some(tx) = self.pending_tx.pop_front() else {
continue;
};
tx.event_sender.unwrap().send(extrinsic).ok();
tracing::info!("tx executed {}", extrinsic_hash);
if let Err(e) = self.db.remove_tx(tx.data.hash){
tracing::error!("Unable to remove tx from db {e}");
};
Expand Down
2 changes: 1 addition & 1 deletion tc-subxt/tests/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ impl ITimechainClient for MockClient {
type Block = MockBlock;
type Update = ();
async fn get_latest_block(&self) -> Result<BlockId> {
Ok(self.best_block.lock().await.clone())
Ok(*self.best_block.lock().await)
}

fn sign_payload<Call>(&self, _call: &Call, params: ExtrinsicParams) -> Vec<u8>
Expand Down
2 changes: 1 addition & 1 deletion tc-subxt/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async fn test_transaction_flow_with_error() -> Result<()> {
env.make_block().await;
let tx = rx.await?;
assert_eq!(tx.nonce, 0);
assert_eq!(tx.success, false);
assert!(!tx.success);
Ok(())
}

Expand Down

0 comments on commit 0d65aef

Please sign in to comment.