Closed rajarshimaitra closed 4 months ago
YES! Regtest framework!! :))))
Test failing becuase apparently cfg!(test)
macro doesn't have any effect on the integration test. We need to set Network::Regtest
for int test to handle address generation correctly.
There are two possible workaround:
Chain::Regtest
enum variant and set that in integration test.int-test
feature and run all the int tests only while under that feature, and the cfg!(feature = "int-test")
to set the network to regtest for in tests.I am inclining for the first option as it seems more cleaner.
This PR adds a basic test framework using the
bitcoind
crate. This is useful to test spending logic in regtest and verify that the most crucial part of the library is working. These tests are enforced in CI too.This PR adds two integration tests using dummy swap values.
Refund: Spend the swap contract via a refund transaction using the timelock.
Some modification of the spend transaction assembly logic was required. And few other auxiliary changes.