Add enaddr
sqlite function for encoding a bitmessage address
#1740
No reviewers
Labels
No Label
bug
build
dependencies
developers
documentation
duplicate
enhancement
formatting
invalid
legal
mobile
obsolete
packaging
performance
protocol
question
refactoring
regression
security
test
translation
usability
wontfix
No Milestone
No project
No Assignees
1 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Bitmessage/PyBitmessage-2024-12-08#1740
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "db_functions"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add
enaddr
sqlite function so that this operation (encoding addresses) can be performed inside sql statements.SELECT
how about
UPDATE pubkeys SET address=enaddr(addressversion, 1, hash)
that doesn't work? I don't know, haven't tried it.
This should be a more specific exception or actually two. One for old python, one for old sqlite.
bad docstring
sqlite.NotSupportedError
for old sqlite,TypeError
for old python@ -0,0 +26,4 @@
# Start SQL thread
sqlLookup = sqlThread()
sqlLookup.daemon = False
sqlLookup.start()
add
sql_ready.wait()
als import
sql_ready
test direct updates and do the other things I mentioned.
this should be a separate method/function, either in
helper_sql
or elsewhere in this file.test content validity, not just if an entry exists.
here also the two exceptions like in
class_sqlThread
this should be cleaned up so that an exception can simply be ignored and treated as a failure by the test suite
@ -0,0 +54,4 @@
sqlExecuteScript(sql_as_string)
def test_create_function(self):
there should be a separate method for creating, and it should be either in
helper_sql
or inclass_sqlThread
. Here it should only test whether it works, not create the function againdocstring missing
I don't think this is necessary as it's created by the sql thread already.
these should be class variables or constants defined elsewhere.
Also version should be 4.
addressversion should be 4
Also I think this would be better inside
class_sqlThread
. This function doesn't need to be called from other places.please make the requested changes
The function is created only when upgrading from version 9 to version 10. This is probably why the tests raise an exception. It should be created always. Perhaps right after creating the cursor.
This section should also be a separate method inside the class
sqlExecute('''DROP TABLE testhash''')
remove
;
remove
;
remove
;
Remove lines 20-22.
I'm not sure this (line 81) actually tests anything. Remove.
remove these lines
@ -358,16 +362,11 @@ class sqlThread(threading.Thread):
logger.debug('In messages.dat database, adding address field to the pubkeys table.')
# We're going to have to calculate the address for each row in the pubkeys
# table. Then we can take out the hash field.
direct update, not joined.
direct update, not join
I think this isn't correct, as xenial returns this:
2021-03-15 11:28:56,156 - ERROR - Got error while pass deterministic in sqlite create function function takes at most 3 arguments (4 given), Passing 3 params
Also fix python3 tests (skip).
My bad. Just downgrade the log to debug severity.
downgrade to
logger.debug
this should say
# python3
# python2
I approve, just the python3 compatibility needs to be fixed in
class_sqlThread.py
andbmconfigparser.py
in a separate PR before this can be merged.@cis-muzahid Please confirm this is obsolete.
This duplicates merged #1751