wallet: refactor: dedup sqlite blob binding #24486

pull theStack wants to merge 1 commits into bitcoin:master from theStack:202203-wallet-refactor-dedup_sqlite_blob_binding changing 1 files +26 −41
  1. theStack commented at 7:17 PM on March 6, 2022: member

    This refactoring PR deduplicates repeated SQLite blob binding to a statement with a newly introduced helper function BindBlobToStatement, abstracting away the calls to sqlite3_bind_blob(...). This should be more readable and less error-prone, e.g. in case that the error handling has to be adapted. As a slight drawback, the function where the binding happens is not printed anymore (__func__), i.e. one could argue this is not strictly a refactoring, but IMHO the advantages of deduplication outweigh this; binding errors are purely internal logic errors (wrong use of the sqlite API) rather than something that is dependend on external data like DB content.

  2. DrahtBot added the label Wallet on Mar 6, 2022
  3. wallet: refactor: dedup sqlite blob binding 8ea6167099
  4. theStack force-pushed on Mar 6, 2022
  5. fanquake requested review from achow101 on Mar 7, 2022
  6. fanquake commented at 9:43 AM on March 7, 2022: member

    CI failure:

     test  2022-03-06T20:03:09.040000Z TestFramework (ERROR): Assertion failed 
                                       Traceback (most recent call last):
                                         File "/tmp/cirrus-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 132, in main
                                           self.run_test()
                                         File "/tmp/cirrus-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/wallet_taproot.py", line 435, in run_test
                                           lambda k1, k2: (key(H_POINT), [multi_a(1, [k1, k2])])
                                         File "/tmp/cirrus-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/wallet_taproot.py", line 336, in do_test
                                           self.do_test_addr(comment, pattern, privmap, treefn, keys[0:nkeys])
                                         File "/tmp/cirrus-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/wallet_taproot.py", line 251, in do_test_addr
                                           assert_equal(addr_g, addr_r)
                                         File "/tmp/cirrus-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/util.py", line 51, in assert_equal
                                           raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args))
                                       AssertionError: not(bcrt1px3pnh5n8npeqr3cv0aq6dvqpcsujrgksfd6hup8dpa62z3m9jf9s3sk3ve == bcrt1pn2xq83tt55vfsxtwhkx96sanchkjzwg6yqxuewvn6emkfyqnyp0qe5cteg)
    
  7. achow101 commented at 10:40 AM on March 7, 2022: member

    CI failure is unrelated

  8. theStack commented at 1:30 PM on March 7, 2022: member

    Restarted the CI for the failing target (the cause of the failure is fixed in #24490).

  9. laanwj commented at 11:56 AM on March 8, 2022: member

    Code review ACK 8ea6167099ddfe9a42464c3c8ae2acd895329d4f

    Nice cleanup.

  10. achow101 commented at 1:11 PM on March 8, 2022: member

    ACK 8ea6167099ddfe9a42464c3c8ae2acd895329d4f

  11. klementtan commented at 12:37 PM on March 10, 2022: contributor

    ACK 8ea6167099ddfe9a42464c3c8ae2acd895329d4f

  12. klementtan approved
  13. fanquake merged this on Mar 10, 2022
  14. fanquake closed this on Mar 10, 2022

  15. theStack deleted the branch on Mar 10, 2022
  16. sidhujag referenced this in commit 17060cf935 on Mar 11, 2022
  17. DrahtBot locked this on Mar 10, 2023


achow101

Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-19 03:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me