breez / breez-sdk-liquid

MIT License
16 stars 3 forks source link

Unit tests: add ability to simulate tx confirmation #451

Open ok300 opened 4 weeks ago

ok300 commented 4 weeks ago

For tests, we now have the trigger_swap_update! macro, which simulates Boltz WS updates. The tests then check if our swap states were correctly updated.

Since some state transitions depend on onchain tx confirmations, we need a similar method to simulate a tx confirmation, perhaps by simulating or mocking sync_payments_with_chain_data.

An example of such state transition is when Chain Swaps move from Pending to Complete when the claim tx is confirmed.

dangeross commented 4 weeks ago

May or may not be related, I have an update in the Webhook PR that allows history to be injected into the mock chain services for simulating txs to be retreived by get_script_history(_with_retry). In this PR it's for mocking the user lockup tx