ElementsProject / libwally-core

Useful primitives for wallets
Other
282 stars 135 forks source link

skip non-applicable tests if BUILD_STANDARD_SECP #358

Closed whitslack closed 1 year ago

whitslack commented 1 year ago

src/anti_exfil.c is empty if BUILD_STANDARD_SECP, so src/test/test_anti_exfil.py fails with:

ERROR: test_anti_exfil (__main__.AntiExfilTests.test_anti_exfil)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "src/test/test_anti_exfil.py", line 21, in test_anti_exfil
    ret = wally_ae_host_commit_from_bytes(entropy, 32, flags, host_commitment, 32)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not callable

Furthermore, src/sign.c omits wally_s2c_sig_from_bytes and wally_s2c_commitment_verify if BUILD_STANDARD_SECP, so src/test/test_sign.py fails with:

ERROR: test_s2c (__main__.SignTests.test_s2c)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "src/test/test_sign.py", line 263, in test_s2c
    self.assertEqual(WALLY_OK, wally_s2c_sig_from_bytes(priv_key, 32, msg, 32, s2c_data, 32, flags, s2c_opening_out, 33, sig_out, 64))
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not callable
jgriffiths commented 1 year ago

@whitslack cherry picked to https://github.com/ElementsProject/libwally-core/pull/351 which will be merged to master soon, thanks!