Commit Graph

530 Commits (7251588e79ae6dab7a2421ba012d7fd7634caaf6)

Author SHA1 Message Date
Franck Royer c11042ff0d
Use `builder` terminology instead of `factory`
3 years ago
Franck Royer 9148af2dbe
`bob::SwapFactory` should be consumed once a swap is returned
3 years ago
Franck Royer 652bfa14a9
Remove unnecessary `pub` qualifiers
3 years ago
Franck Royer b21dc03ed0
`alice::SwapFactory` should be consumed once a swap is returned
3 years ago
Franck Royer 9b32409b8d
Remove unnecessary `allow(clippy)`
3 years ago
Franck Royer 9e3ef7ea24
Remove `StartingBalances` from release code
3 years ago
Franck Royer 181999e04f
Remove unnecessary `alice` qualifiers in `alice::SwapFactor`
3 years ago
Franck Royer 3bc76a91c6
Make `init_state` associated to `bob::SwapFactory`
3 years ago
Franck Royer f0e6e45d56
Remove unecessary `bob` qualifier
3 years ago
Franck Royer dbc633ea06
Remove unecessary `connect` qualifier
3 years ago
Franck Royer e26629b593
Remove unecessary fields from `bob::SwapFactory`
3 years ago
Franck Royer 3c68026cfe
Move init event loop in `bob::SwapFactory`
3 years ago
Franck Royer 96b1b18037
Keep terminology consistent
3 years ago
Daniel Karzel 28429fa9fe Revert log statement
3 years ago
Daniel Karzel 37f619dbfc Move StartingBalances into protocol module
3 years ago
Daniel Karzel 41e335fc2d Error messages instead of unreachable
3 years ago
Daniel Karzel 2dceab28a4 Derive Default
3 years ago
Daniel Karzel acfd43ee79 Rename Test to TestContext and argument to ctx
3 years ago
Daniel Karzel e91987e23f Fix rand import
3 years ago
Daniel Karzel 170e90ffed Rename do_run_until to _run_until_internal
3 years ago
Daniel Karzel 82974412b2 Remove roles from SwapFactory name as implied by module and cleanup
4 years ago
Daniel Karzel 75f89f3b25 Use Bob swap factory in production
4 years ago
Daniel Karzel e56c48ee23 Remove unused type
4 years ago
Daniel Karzel 3398ef8236 Use Alice swap factory in production
4 years ago
Daniel Karzel 67e925fe1f Refactor Bob's peer-id and identity to be handled on the outside
4 years ago
Daniel Karzel 0c19af9090 Refactor Alice's peer-id and identity to be handled on the outside
4 years ago
Daniel Karzel 8bf467b550 Make the factory code usable in production
4 years ago
Daniel Karzel e4795fa4ee Fix recursive call to swap by using run_until
4 years ago
bors[bot] 35c42263df
Merge #145
4 years ago
bors[bot] a7f68e4aa1
Merge #144
4 years ago
Franck Royer 9a823dca4c
Do not introduced State6
4 years ago
bors[bot] 974b6ebf6f
Merge #136
4 years ago
Daniel Karzel d4316f0cfe Print each monero confirmation for Bob
4 years ago
Daniel Karzel 8615aaed6e Make lock-tx id available in redeem/punish state to be able to assert exact fees
4 years ago
Daniel Karzel 317b251302 Re-arrange order of structs/functions in testutils
4 years ago
Daniel Karzel 7832ee94f3 Remove unused code and only expose necessary functionality
4 years ago
Daniel Karzel 8ef8240771 Refactor refund test
4 years ago
Daniel Karzel 55024572ae Refactor punish test and punish assertions
4 years ago
Daniel Karzel 73a2841ec5 Refactor happy path bob restart tests
4 years ago
Daniel Karzel 8a2eb07928 Harmonize names and structure
4 years ago
Daniel Karzel bede1c13dd Refactor Bob's side (happy path + alice restart)
4 years ago
Daniel Karzel 59f9a1c286 Fix usage of StartingBalance in Alice and Bob
4 years ago
Daniel Karzel 87edec0d50 Rename Alice's factory to harness and include redeem assertions
4 years ago
Daniel Karzel 152c8d7eba Refactor Alice restart test by introducing factory for creating Alices
4 years ago
Daniel Karzel b031bc5e42 Re-export run_until
4 years ago
rishflab 537d05e01e Add reusable test function
4 years ago
rishflab 9cbf6e9774 Re-export event loop handles
4 years ago
rishflab 6040f2ae63 Re-export event loops
4 years ago
rishflab e8fdf62623 Re-export swap function
4 years ago
rishflab f5cfe014be Fix imports
4 years ago
Franck Royer 31c63f0c4d
Remove dead code
4 years ago
Franck Royer 0852f90473
Remove unused variant
4 years ago
Daniel Karzel f8848aca55 Describe additional state for ToDo that might cause trouble
4 years ago
Daniel Karzel 59f01ad680 Remove Todo that was already actioned
4 years ago
Daniel Karzel 60f3923a63 Set tracing level to Info in production code
4 years ago
Daniel Karzel 00b4f3110f Remove ToDo that is already actioned
4 years ago
Daniel Karzel ab9117aa4c Log Alice's lock tx proof receive on Bob's side
4 years ago
Daniel Karzel af45206fde Remember the block-height before XMR lock for generated monero wallet restore height
4 years ago
bors[bot] ca6ba78862
Merge #123
4 years ago
Daniel Karzel 664958939d Create network::Seed from swap::Seed instead of abstracting over byte array
4 years ago
Daniel Karzel f18d01dfaf Deterministic peer id from seed for bob
4 years ago
Daniel Karzel 0a21040e08 Deterministic peer id from seed for alice
4 years ago
Franck Royer 6ffc66867c
Typo
4 years ago
Franck Royer 047f990d05
Improve error reporting on signature verification
4 years ago
Franck Royer ef906876a0
Increase timelocks on testnet
4 years ago
Franck Royer 17356eaff9
Do not guard waiting for encrypted signature with arbitrary timeout
4 years ago
Franck Royer 95ecb02e7a
Small changes to make debugging easier and tests
4 years ago
Franck Royer 9d8f8b0a1f
P2p socket should be listening for external connections
4 years ago
rishflab 1c644cb377 Rename message behaviours
4 years ago
rishflab 5d7d72c826 Remove unused import
4 years ago
rishflab 387a4da2f6 Make modules private
4 years ago
rishflab dcea54dbf1 Move protocol parent states into appropriate module
4 years ago
rishflab f64eede5d8 Move monero ser/deser to monero module
4 years ago
rishflab e7c00d742e Re-export bitcoin and monero types
4 years ago
rishflab c900d12593 Merge xmr_btc crate
4 years ago
Daniel Karzel 487b880371 Cleanup unused config param that was accidentally introduced
4 years ago
Daniel Karzel e031681369 Add minimum monero confirmations to config use it for Bob
4 years ago
Daniel Karzel c6bc45e7a0 Wait for bitcoin tx finality before locking XMR
4 years ago
Daniel Karzel 30dd15774e Log Bitcoin and Monero transaction IDs on info instead of debug
4 years ago
Daniel Karzel 0977d36703 Set log level to info instead of trace
4 years ago
Daniel Karzel 8a2128e93a Correct monero-wallet-rpc parameter name
4 years ago
Daniel Karzel 4d9559fc2e Monero network settings and testnet
4 years ago
Daniel Karzel 1f7e72b230 Log bitcoin harness and monero harness
4 years ago
Franck Royer dd10e68db4
Merge pull request #113 from comit-network/clippy
4 years ago
Franck Royer bcbc54b569
Type timelock and block height
4 years ago
Franck Royer 81cbc24c46
Use action to name trait
4 years ago
Franck Royer e1e8533862
Embed state mod in database mod
4 years ago
Franck Royer 59708c57e6
Move Alice and Bob db states in separate modules
4 years ago
Franck Royer b410de01df
Move state.rs under database module
4 years ago
Franck Royer 8c7964bfee
Rename storage.rs to database.rs to reduce terminology variants
4 years ago
Franck Royer 5ed18469e4
Move db state conversion with db type definition
4 years ago
Franck Royer 2a778f5644
Remove overzealous clippy overrides
4 years ago
Franck Royer cdf2800fa5
Align clippy lints
4 years ago
Franck Royer ece689f5ca
There is only one binary, we should use `main.rs` naming convention
4 years ago
Franck Royer 4150e75488
Replace `Try_From` state conversion with `From` for Bob
4 years ago
Franck Royer 5d1b10cc58
Align Bob DB states with swap states
4 years ago
Franck Royer e541f7b83d
Replace `TryFrom` with `From` for Alice states
4 years ago
Franck Royer 69e1c2bb27
Align Alice DB states with swap states
4 years ago
Franck Royer a31db63e54
Improve state names and display
4 years ago
Franck Royer f0736d0906
Remove Refund timelock and T0/T1/T2
4 years ago
Franck Royer 405e377f79
Rename `EncSign` to `EncSig`
4 years ago
bors[bot] 9c83ca52ad
Merge #107
4 years ago
Franck Royer 297b15e3ce
Remove async block when it is not needed
4 years ago
Franck Royer e079b84500
Ensure we wait for other party to complete
4 years ago
Franck Royer 1fa812b727
Separate Buy/Sell for resume command
4 years ago
Daniel Karzel a692cf9299 Remove all short-codes because they don't add value at the moment
4 years ago
Daniel Karzel c9d492d155 Only wait for xmr-lock until t1 expired
4 years ago
Daniel Karzel 83ce6f2c85 Ensure that Bob can cancel correctly if T1 expired and Alice did not move
4 years ago
Daniel Karzel 8296490764
Merge pull request #111 from comit-network/trace-xmr-btc
4 years ago
Daniel Karzel 5f8b7f2624 Fix tracing subscribe filter for xmr-btc`
4 years ago
Franck Royer 40a27a2438
Remove dead code
4 years ago
Franck Royer df237f82cf
Fix clippy warning
4 years ago
Franck Royer 49b84d84b9
Add address at the start
4 years ago
Franck Royer 1e4b115556
Separate Bob restart tests
4 years ago
Franck Royer e366d3a73b
Join all futures to avoid hanging tests
4 years ago
Franck Royer 2abf65f3b6
Remove sleep that seems unnecessary
4 years ago
Franck Royer 4a4e23038b
Add logging to investigate add address race condition
4 years ago
Franck Royer 1a4bd0e2b4
Bob refunds swap after restart that requires communication
4 years ago
Franck Royer d9ea7ab605
Only carry the tx_lock_id instead of the full state
4 years ago
Franck Royer edfab58246
Scope alice db
4 years ago
Franck Royer dc96b3d1e9
Stop running first event loop after Alice restarts
4 years ago
Franck Royer 638143a10d
Replace hard coded port by dynamic available one
4 years ago
Franck Royer 2212758d17
Rename refund test as it is alice specific
4 years ago
bors[bot] 3db71997d3
Merge #99
4 years ago
bors[bot] 4f631c0c9b
Merge #98
4 years ago
bors[bot] 88c29dbce5
Merge #94
4 years ago
Daniel Karzel 4046305474
Merge pull request #88 from comit-network/resume-swap-cli
4 years ago
Daniel Karzel 20893c1bb1 Cleanup Display for database states
4 years ago
Daniel Karzel e6493784bf Change `pin_mut!` to `select!`
4 years ago
Daniel Karzel 773eebc723 Cleanup resume_from_database functions only used in tests
4 years ago
Daniel Karzel e9681b6e2b Work in review comments
4 years ago
Daniel Karzel 43d05935e7 Remove tor module
4 years ago
Daniel Karzel 093cbaa4b4 Introduce T1Expired state for Bob properly and check expiries in states after both locked
4 years ago
Daniel Karzel 6d03d1bbff Resume command and global database cl-parameter
4 years ago
Franck Royer 71cf501c29
Delete `bob::negotiate`
4 years ago
Franck Royer 19066200d1
Add a TODO to use existing helper functions
4 years ago
Franck Royer 84bec0631b
Rename alice::negotiate to steps
4 years ago
Franck Royer 53d13330c2
Remove dupe code
4 years ago
rishflab 9d266fc648 Add balance assertions to restart tests
4 years ago
Franck Royer 5ba830f3bf
Replace swap `recover` terminology with `resume`
4 years ago
Franck Royer 8cc470a80e
Use `-ed` terminology for cancel state
4 years ago
Daniel Karzel b83ab71669
Split up tests into separate files to overcome CI failure
4 years ago
Daniel Karzel 7cae6a9e4d
Add Bob restart test
4 years ago
Daniel Karzel 4ec2da29a0
Modularize Bob's test setup (separate init for state, event_loop)
4 years ago
Daniel Karzel 9a930af33f
Remove duplicated restart+refund test, move tests into separate files
4 years ago
Daniel Karzel 91d4d5da25
Cleanup swap execution to not return EventLoopHandle, refactor both_refund test
4 years ago
Daniel Karzel 3692046758
Bob's recover function
4 years ago
Daniel Karzel bf39c34ada
Alice restart and refund test if restarted before encsig learner
4 years ago
Daniel Karzel 8c929564ef
Refactor container initialization
4 years ago
rishflab 143d8bc07d
Move message0 response handler out of NB
4 years ago
Daniel Karzel 4143394767
Add recovery function for Alice
4 years ago
rishflab 4b00141c29
Fix happy path test
4 years ago
Franck Royer 7092af457a
Introduced DB for Alice & Bob
4 years ago
Franck Royer 4ce8695dfc
Align with origin/database
4 years ago
Franck Royer 1a5b9f9fa9
Update tests after rebase
4 years ago
Franck Royer c4cdd098fd
Use from instead of try_from for Alice state conversion
4 years ago
Franck Royer caf903acda
wip: Add test for when bob restarts
4 years ago
Franck Royer 905fc6cf35
Save Bob state during swap
4 years ago
Franck Royer 7e0a1ffe84
Remove generator for bob
4 years ago
Franck Royer c6af5eb9ac
Introduce test where alice restarts before all communications are done
4 years ago
Franck Royer 3580b7ed2c
Add test where Alice restart after encsign is learned
4 years ago
Franck Royer a22efaa7bc
Remove unneeded peer id argument
4 years ago
Franck Royer 9323f22009
Reorder calls
4 years ago
Franck Royer a24d1a49b9
Remove unneeded `as_ref_calls`
4 years ago
Franck Royer 1c7cc7ee46
Scope futures' instanciation
4 years ago
Franck Royer 6226e5789f
Introduce test where alice restart mid-swap
4 years ago
Franck Royer 71a0832ef4
Add zero const to monero::Amount
4 years ago
Franck Royer 64b021daf4
Save Alice states in db
4 years ago
Franck Royer 238f6a989d
Extract spend key as soon as possible
4 years ago
Franck Royer c095693a5f
Refund swap if resumed from a step that requires further communication
4 years ago
Franck Royer 11cea9ba69
Remove passing alice peer id
4 years ago
rishflab d8d6477ee9 Remove and fix comments
4 years ago
rishflab 082f4eb005 Use unused port in refund test
4 years ago
rishflab 7af4b6980a Test Alice refunds after Bob refund
4 years ago
rishflab 773390886b Test that Bob refunds if Alice fails to act
4 years ago
rishflab 78c6a1a78f Add Bob refund execution
4 years ago
rishflab f806ad7231 Assert balances after punish
4 years ago
bors[bot] 9fecf7008e
Merge #61
4 years ago
Daniel Karzel 03b8e5f52e Upgrade CLI for mainnet test
4 years ago
Daniel Karzel aad7a22f81 Utility function for initializing tracing for tests
4 years ago
Franck Royer c0478d7191
Move expiries to config
4 years ago
Franck Royer ef6e8fc723
Clean-up unused code
4 years ago
Franck Royer e71bf7d8e9
Add comment regarding processing in network behaviour
4 years ago
Franck Royer 2c9fb7b1da
Rename var to match type name
4 years ago
Franck Royer 91d28682ed
Remove comments
4 years ago
Franck Royer 53aae5cf5f
Use anyhow macro as intended
4 years ago
Franck Royer 51cc44484b
Remove unneeded pub qualifiers
4 years ago
rishflab 9ba89194b0 Rename swarm driver to event loop
4 years ago
rishflab f5d3d54b13 Prevent premature Bob t1 timeout
4 years ago
rishflab 27d1334726 Init Alice behaviour with state0
4 years ago
rishflab 3d8866f1a0 Convert event loop to use fused futures select
4 years ago
rishflab 58da1df9dc Create SwarmDriverHandle to resolve ownership issues
4 years ago
rishflab 6f7408ecce Drive swarm in seperate async task
4 years ago
rishflab f88ed9183b
Merge pull request #54 from comit-network/bob-unhappy-paths
4 years ago
rishflab bd8e6e36e0 Fix monero blocktime config
4 years ago
Daniel Karzel 1a2857af29 Properly init tracing per test and reverse the filter to be exclusive
4 years ago
rishflab 883a913f30 Remove nonsensical monero * monero multiplication
4 years ago
rishflab 627b1a9f00 Remove unnecessary execution restart
4 years ago
rishflab 8592ef5f79 Address PR feedback
4 years ago
Franck Royer 78674818c2
Upgrade bitcoin-harness
4 years ago
rishflab b4ac69fa9c Reduce stack size to prevent CI resource issues
4 years ago
rishflab e4eed7b1a5 Change multiaddr for test runs
4 years ago
rishflab c91e9652aa Add alice punish test
4 years ago
rishflab 5fef68322a Allow Alice to exit execution at a specified state
4 years ago
rishflab 584cc22024 Allow Bob to exit execution at a specified state
4 years ago
Franck Royer cfcd1e7170
Clean-up dep versions
4 years ago
Franck Royer 624716d8a7
Upgrade rust-bitcoin to 0.25
4 years ago
Franck Royer c3e43f50aa
Update bitcoin-harness to specific revision
4 years ago
Franck Royer 765482b0aa
Implement `wait_for_transaction_finality`
4 years ago
rishflab 1c401aad31 Fix clippy warnings and formatting
4 years ago
rishflab b06321a40f WIP: cleanup
4 years ago
rishflab 47c3ddc6f7 Fix happy path test
4 years ago
Franck Royer 2abeba17f9
Save state0 in the swarm to process message0
4 years ago
rishflab d8218a7bea Remove mspc channel from new executor
4 years ago
Franck Royer 2db9ebd28b make new_swarm public
4 years ago
Franck Royer 9e13034e54 Extract execution details from driving loop
4 years ago
rishflab 24631d464d Add test for recursive executor
4 years ago
rishflab dca15b6872 Removed unused binary
4 years ago
rishflab 3b005bd15c Resolve rebase issues, restructure code and fix warnings
4 years ago
Franck Royer 437c1cbb80 Started to extract some steps
4 years ago
Franck Royer 66866f8fbd Remove rng argument
4 years ago
Franck Royer 6c0df836ca Deal with Btc Punished.
4 years ago
Franck Royer 6437b529eb Punish Bob if t2 is reached
4 years ago
Franck Royer 8ff1824126 Remove abort function
4 years ago
Franck Royer 58ca33dd04 Remove warnings
4 years ago
Franck Royer c501d84278 Park abort function for now
4 years ago
Franck Royer 4c4a10098c Complete Refund path
4 years ago
Franck Royer bff83bbe99 Progress on Cancellation path
4 years ago
Franck Royer 8e31a3af6a Add steps from `EncSignLearned`
4 years ago
Franck Royer 8976a03b3d Implemented Alice transition from `BtcLocked` to `XmrLocked`
4 years ago
Franck Royer 75e7fedfed Implemented Alice transition from `Negotiated` to `BtcLocked`
4 years ago
Franck Royer c4cd64d134 Implemented Alice transition from `Started` to `Negotiated`
4 years ago
Franck Royer 0fe5131a8a Fix import format
4 years ago
rishflab ae94b170fd Cleanup
4 years ago
rishflab ff7daf16f3 WIP: Test simplified swap execution
4 years ago
rishflab dd07e2f882 Add Alice execution path
4 years ago
Lucas Soriano del Pino 483c819e17 Correctly re-export types from bitcoin and monero modules
4 years ago
Lucas Soriano del Pino f5ff50157e Some more fixes and comments after testing Alice's recovery
4 years ago
Lucas Soriano del Pino bea99185ed Use correct default values for monerod_url*
4 years ago
Lucas Soriano del Pino 5930af3587 Move some things around in recover module
4 years ago
Lucas Soriano del Pino 33b36c98fa Configure binary tracing level for xmr_btc and monero_harness
4 years ago
Lucas Soriano del Pino 5dede0f361 Add more logging to recovery
4 years ago
rishflab 11a7963081 Fix bugs
4 years ago
Lucas Soriano del Pino f0d90130ad Add recovery command
4 years ago
Lucas Soriano del Pino 09773dd15b Re-introduce history command
4 years ago
rishflab 0f1a77fa21 Fix Alice's btc redeem recovery path
4 years ago
Lucas Soriano del Pino 6db40dce2a Implement swap recover function for Bob
4 years ago
Lucas Soriano del Pino 28225f8643 Implement swap recover function for Alice
4 years ago
Lucas Soriano del Pino b989e94322 Remove stale TODO
4 years ago
Lucas Soriano del Pino 33a111d879 Move Swap state out of storage
4 years ago