Commit Graph

137 Commits

Author SHA1 Message Date
rishflab
f88ed9183b
Merge pull request #54 from comit-network/bob-unhappy-paths
Punish Test
2020-12-09 15:51:16 +11:00
rishflab
bd8e6e36e0 Fix monero blocktime config 2020-12-09 15:10:29 +11:00
Daniel Karzel
1a2857af29 Properly init tracing per test and reverse the filter to be exclusive
Tracing should be initialized by test and the `_guard` kept alive within the test.
Re-using this code in different tests does not really have any additional value.

Instead of specifying what messages we want to include, I went for a filter that excludes noise.
That way we get more useful logging.
2020-12-09 11:48:53 +11:00
rishflab
883a913f30 Remove nonsensical monero * monero multiplication 2020-12-08 16:12:00 +11:00
rishflab
627b1a9f00 Remove unnecessary execution restart 2020-12-07 14:03:50 +11:00
rishflab
8592ef5f79 Address PR feedback
Add context to logging statements. Use amount type for monero in tests. Remove stale
code and comments.
2020-12-07 13:55:13 +11:00
Franck Royer
78674818c2
Upgrade bitcoin-harness 2020-12-07 12:31:25 +11:00
rishflab
b4ac69fa9c Reduce stack size to prevent CI resource issues 2020-12-07 09:44:26 +11:00
rishflab
e4eed7b1a5 Change multiaddr for test runs 2020-12-05 14:06:08 +11:00
rishflab
c91e9652aa Add alice punish test
Use reusable test init functions for happy path test

Extract tracing setup to reusable function

Move test initialization to seperate functions

Increase stack size in CI

Fix monero max finality time

Force Bob swarm polling to send message 2

Run Bob state to xmr_locked in punish test to force the sending of
message2. Previously Bob state was run until btc_locked. Although
this was the right thing to do, message2 was not being sent as the
swarm was not polled in btc_locked. Alice punish test passes.

Add info logging to executor
2020-12-04 17:23:37 +11:00
rishflab
5fef68322a Allow Alice to exit execution at a specified state 2020-12-04 17:16:03 +11:00
rishflab
584cc22024 Allow Bob to exit execution at a specified state 2020-12-04 17:16:03 +11:00
Franck Royer
cfcd1e7170
Clean-up dep versions
- Use bitcoin-harness 0.2
- Use cross-curve-dleq latest master commit
2020-12-04 16:56:08 +11:00
Franck Royer
624716d8a7
Upgrade rust-bitcoin to 0.25 2020-12-04 08:11:55 +11:00
Franck Royer
c3e43f50aa
Update bitcoin-harness to specific revision 2020-12-02 11:32:34 +11:00
Franck Royer
765482b0aa
Implement wait_for_transaction_finality 2020-12-02 10:02:20 +11:00
rishflab
1c401aad31 Fix clippy warnings and formatting 2020-12-01 15:38:24 +11:00
rishflab
b06321a40f WIP: cleanup 2020-12-01 14:46:53 +11:00
rishflab
47c3ddc6f7 Fix happy path test
Poll bob swarm to send encsig after calling send message3. Comment
out unimplmented wait for transaction finality trait. Dial alice.
2020-12-01 14:30:02 +11:00
Franck Royer
2abeba17f9
Save state0 in the swarm to process message0 2020-12-01 10:41:10 +11:00
rishflab
d8218a7bea Remove mspc channel from new executor 2020-11-30 15:16:56 +11:00
Franck Royer
2db9ebd28b make new_swarm public 2020-11-30 15:13:20 +11:00
Franck Royer
9e13034e54 Extract execution details from driving loop 2020-11-30 15:13:20 +11:00
rishflab
24631d464d Add test for recursive executor 2020-11-30 15:13:20 +11:00
rishflab
dca15b6872 Removed unused binary 2020-11-30 15:13:20 +11:00
rishflab
3b005bd15c Resolve rebase issues, restructure code and fix warnings 2020-11-30 15:13:20 +11:00
Franck Royer
437c1cbb80 Started to extract some steps
Tealised that the whole point is for them to be idempotent to be useful
2020-11-27 09:34:36 +11:00
Franck Royer
66866f8fbd Remove rng argument 2020-11-27 09:34:36 +11:00
Franck Royer
6c0df836ca Deal with Btc Punished. 2020-11-27 09:34:36 +11:00
Franck Royer
6437b529eb Punish Bob if t2 is reached 2020-11-27 09:34:36 +11:00
Franck Royer
8ff1824126 Remove abort function 2020-11-27 09:34:36 +11:00
Franck Royer
58ca33dd04 Remove warnings 2020-11-27 09:34:36 +11:00
Franck Royer
c501d84278 Park abort function for now 2020-11-27 09:34:36 +11:00
Franck Royer
4c4a10098c Complete Refund path 2020-11-27 09:34:36 +11:00
Franck Royer
bff83bbe99 Progress on Cancellation path 2020-11-27 09:34:36 +11:00
Franck Royer
8e31a3af6a Add steps from EncSignLearned 2020-11-27 09:34:36 +11:00
Franck Royer
8976a03b3d Implemented Alice transition from BtcLocked to XmrLocked 2020-11-27 09:34:35 +11:00
Franck Royer
75e7fedfed Implemented Alice transition from Negotiated to BtcLocked 2020-11-27 09:34:35 +11:00
Franck Royer
c4cd64d134 Implemented Alice transition from Started to Negotiated 2020-11-27 09:34:35 +11:00
Franck Royer
0fe5131a8a Fix import format 2020-11-27 09:34:35 +11:00
rishflab
ae94b170fd Cleanup
Move state machine executors into seperate files

Remove check for ack message from Alice. Seems like a bad idea to
rely on an acknowledgement message instead of looking at the
blockchain.

Fix warnings
2020-11-27 09:34:35 +11:00
rishflab
ff7daf16f3 WIP: Test simplified swap execution 2020-11-27 09:21:21 +11:00
rishflab
dd07e2f882 Add Alice execution path
Consolidate and simplify swap execution. Generators are no longer
needed. Consolidate recovery and swap data structures. The
recursive calls can be replaced with a loop if returning prior to
completion is desired for testing purposes.

Fill out alice abort path

Move state machine executors into seperate files

Not compiling due to recursion/async issues

Fix async recursion compilation errors

Fix Bob swap execution

Remove check for ack message from Alice. Seems like a bad idea to
rely on an acknowledgement message instead of looking at the
blockchain.

Fix Bob abort

Fix warnings

Xmr lock complete

Add TxCancel submit to XmrLocked

Bob swap completed

Remove alice
2020-11-27 09:21:21 +11:00
Lucas Soriano del Pino
483c819e17 Correctly re-export types from bitcoin and monero modules 2020-11-12 13:49:07 +11:00
Lucas Soriano del Pino
f5ff50157e Some more fixes and comments after testing Alice's recovery 2020-11-12 13:49:07 +11:00
Lucas Soriano del Pino
bea99185ed Use correct default values for monerod_url*
*`monerod_url` is an incorrect name as it's actually a
`monero_wallet_rpc_url`. This is fixed in another branch.
2020-11-12 13:49:07 +11:00
Lucas Soriano del Pino
5930af3587 Move some things around in recover module 2020-11-12 13:49:07 +11:00
Lucas Soriano del Pino
33b36c98fa Configure binary tracing level for xmr_btc and monero_harness 2020-11-12 13:49:07 +11:00
Lucas Soriano del Pino
5dede0f361 Add more logging to recovery
Also, remove redundant timelock check.
2020-11-12 13:49:07 +11:00
rishflab
11a7963081 Fix bugs 2020-11-12 13:49:07 +11:00