ElementsProject / libwally-core

Useful primitives for wallets
Other
280 stars 134 forks source link

test/test_transaction.py: test_serialization fails if libwallycore is built without SWIG #407

Closed whitslack closed 12 months ago

whitslack commented 12 months ago

Looks similar to #385.

./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu \
  --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share \
  --sysconfdir=/etc --localstatedir=/var/lib \
  --disable-dependency-tracking --disable-silent-rules \
  --docdir=/usr/share/doc/libwally-core-0.9.1 \
  --htmldir=/usr/share/doc/libwally-core-0.9.1/html \
  --with-sysroot=/ --libdir=/usr/lib64 --includedir=/usr/include/libwally \
  --enable-export-all --enable-tests --enable-elements \
  --disable-standard-secp --disable-minimal --enable-asm \
  --disable-swig-java --disable-swig-python
PYTHONDONTWRITEBYTECODE=1 python3.11 test/test_transaction.py
.......E.
======================================================================
ERROR: test_serialization (__main__.TransactionTests.test_serialization)
Testing serialization and deserialization
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/net-libs/libwally-core-0.9.1/work/libwally-core-release_0.9.1/src/test/test_transaction.py", line 82, in test_serialization
    for i in range(wally_tx_get_num_inputs(tx_copy)[1]):
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/net-libs/libwally-core-0.9.1/work/libwally-core-release_0.9.1/src/test/util.py", line 1084, in <lambda>
    def mksize_t(f): return lambda *args: size_t_fn_wrapper(f, *args)
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/portage/net-libs/libwally-core-0.9.1/work/libwally-core-release_0.9.1/src/test/util.py", line 1053, in size_t_fn_wrapper
    ret = fn(*new_args)
          ^^^^^^^^^^^^^
TypeError: 'NoneType' object is not callable

----------------------------------------------------------------------
Ran 9 tests in 0.012s

FAILED (errors=1)
make: *** [Makefile:2322: check-libwallycore] Error 1
jgriffiths commented 12 months ago

Gah, another one from https://github.com/ElementsProject/libwally-core/issues/388.

Fix pushed to master, thanks for reporting @whitslack

whitslack commented 12 months ago

Yep, that fixes it. Thank you.