From cdb539446ef3b4234c0bd74dbd78552cd300a918 Mon Sep 17 00:00:00 2001 From: Aaron Blankstein Date: Tue, 24 Sep 2024 20:31:12 -0500 Subject: [PATCH] use * in mempool SELECT --- stackslib/src/core/mempool.rs | 16 +--------------- stackslib/src/core/tests/mod.rs | 2 +- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/stackslib/src/core/mempool.rs b/stackslib/src/core/mempool.rs index 9b917b608a..28560d9a80 100644 --- a/stackslib/src/core/mempool.rs +++ b/stackslib/src/core/mempool.rs @@ -2015,21 +2015,7 @@ impl MemPoolDB { nonce: u64, ) -> Result, db_error> { let sql = format!( - "SELECT - txid, - origin_address, - origin_nonce, - sponsor_address, - sponsor_nonce, - tx_fee, - length, - consensus_hash, - block_header_hash, - height, - accept_time, - last_known_sponsor_nonce, - last_known_origin_nonce - FROM mempool WHERE {0}_address = ?1 AND {0}_nonce = ?2", + "SELECT * FROM mempool WHERE {0}_address = ?1 AND {0}_nonce = ?2", if is_origin { "origin" } else { "sponsor" } ); let args = params![addr.to_string(), u64_to_sql(nonce)?]; diff --git a/stackslib/src/core/tests/mod.rs b/stackslib/src/core/tests/mod.rs index 72b29cc097..01fcac9e89 100644 --- a/stackslib/src/core/tests/mod.rs +++ b/stackslib/src/core/tests/mod.rs @@ -1381,7 +1381,7 @@ fn mempool_do_not_replace_tx() { .unwrap_err(); assert!(match err_resp { MemPoolRejection::ConflictingNonceInMempool => true, - _ => false, + e => panic!("Failed: {e:?}"), }); assert!(MemPoolDB::db_has_tx(&mempool_tx, &prior_txid).unwrap());