From 07953592aa95df670f01b600ab904c39c8008374 Mon Sep 17 00:00:00 2001 From: Kashiko Koibumi Date: Thu, 30 May 2024 20:09:16 +0900 Subject: [PATCH] fix careless mistakes --- src/api.py | 4 ++-- src/bitmessageqt/__init__.py | 2 +- src/tests/core.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/api.py b/src/api.py index 87af4d32..80e9c24d 100644 --- a/src/api.py +++ b/src/api.py @@ -1467,10 +1467,10 @@ class BMRPCDispatcher(object): # Stream Number length readPosition += decodeVarint( payload[readPosition:readPosition + 10])[1] - t = (payload[readPosition:readPosition + 32], sqlite3.Binary(hash01)) + t = (sqlite3.Binary(payload[readPosition:readPosition + 32]), sqlite3.Binary(hash01)) _, rowcount = sql.execute("UPDATE inventory SET tag=? WHERE hash=?", *t) if rowcount < 1: - t = (payload[readPosition:readPosition + 32], hash01) + t = (sqlite3.Binary(payload[readPosition:readPosition + 32]), hash01) sql.execute("UPDATE inventory SET tag=? WHERE hash=CAST(? AS TEXT)", *t) queryreturn = sqlQuery( diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 42ef6f80..add5fb95 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -3277,7 +3277,7 @@ class MyForm(settingsmixin.SMainWindow): if total_row_count < 1: sqlExecuteChunked( "UPDATE inbox SET folder='inbox' WHERE msgid IN({0})", - True, idCount, *inventoryHashesToTrash, as_text=True) + True, idCount, *inventoryHashesToTrash) tableWidget.selectRow(0 if currentRow == 0 else currentRow - 1) tableWidget.setUpdatesEnabled(True) self.propagateUnreadCount() diff --git a/src/tests/core.py b/src/tests/core.py index aa42ada0..c0de4d3b 100644 --- a/src/tests/core.py +++ b/src/tests/core.py @@ -357,7 +357,7 @@ class TestCore(unittest.TestCase): if len(column_type) < 1: column_type = sqlQuery( '''select typeof(msgid) from sent where ackdata=CAST(? AS TEXT)''', result) - self.assertEqual(column_type[0][0] if column_type else '', 'text') + self.assertEqual(column_type[0][0] if column_type else '', 'blob') @unittest.skipIf(frozen, 'not packed test_pattern into the bundle') def test_old_knownnodes_pickle(self):