ElementsProject / elements

Open Source implementation of advanced blockchain features extending the Bitcoin protocol
MIT License
1.06k stars 380 forks source link

policyAsset not set in c++ unit tests #408

Closed nkostoulas closed 1 month ago

nkostoulas commented 6 years ago

Policy/fee asset doesn't seem to be set in the src/test unit-tests. I noticed this in txvalidationcache_tests.cpp, where the fee output was discarded when the tx was entered in the mempool as in AcceptToMemoryPoolWorker the following returns 0:

CAmount nFees = tx.GetFee()[policyAsset];

Although it doesn't break anything as zero fees are allowed, it might hide intended functionality if something changed. Do you think it would make sense to add this in the test_bitcoin configuration?

instagibbs commented 6 years ago

yes, thank you

instagibbs commented 6 years ago

Do you have a backtrace for the issue?

nkostoulas commented 6 years ago
FAIL: test/test_elements
========================

Running 210 test cases...
unknown location:0: fatal error: in "tx_validationcache_tests/tx_mempool_block_doublespend": signal: SIGSEGV, si_code: 0 (memory access violation at address: 0x00000000)
test/txvalidationcache_tests.cpp:70: last checkpoint

*** 1 failure is detected in the test module "Bitcoin Test Suite"
Assertion failed: (!pthread_mutex_destroy(&m)), function ~recursive_mutex, file /usr/local/include/boost/thread/pthread/recursive_mutex.hpp, line 104.
FAIL test/test_elements (exit status: 134)

Is there a way to get a detailed trace?

instagibbs commented 6 years ago

Does your change fix it? That's a good indicator!

On Wed, Sep 12, 2018, 8:54 AM Nikos Kostoulas notifications@github.com wrote:

FAIL: test/test_elements

Running 210 test cases... unknown location:0: fatal error: in "tx_validationcache_tests/tx_mempool_block_doublespend": signal: SIGSEGV, si_code: 0 (memory access violation at address: 0x00000000) test/txvalidationcache_tests.cpp:70: last checkpoint

*** 1 failure is detected in the test module "Bitcoin Test Suite" Assertion failed: (!pthread_mutex_destroy(&m)), function ~recursive_mutex, file /usr/local/include/boost/thread/pthread/recursive_mutex.hpp, line 104. FAIL test/test_elements (exit status: 134)

Is there a way to get a detailed trace?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ElementsProject/elements/issues/408#issuecomment-420700955, or mute the thread https://github.com/notifications/unsubscribe-auth/AFgC06zx8D5FHO4yJ6UC7sRaZViUr7sIks5uaS48gaJpZM4WhtWU .

nkostoulas commented 6 years ago

Yea it does! I was just curious why it was happening.

instagibbs commented 6 years ago

We can keep this issue open if you like even if we merge the fix.

On Wed, Sep 12, 2018, 8:59 AM Nikos Kostoulas notifications@github.com wrote:

Yea it does! I was just curious why it was happening.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ElementsProject/elements/issues/408#issuecomment-420702660, or mute the thread https://github.com/notifications/unsubscribe-auth/AFgC07e3xKLayFjTerWtvaIo5kpgFEHSks5uaS9kgaJpZM4WhtWU .