Commit Graph

1027 Commits (master)

Author SHA1 Message Date
Franck Royer e079b84500
Ensure we wait for other party to complete
3 years ago
Franck Royer 1fa812b727
Separate Buy/Sell for resume command
3 years ago
Daniel Karzel a692cf9299 Remove all short-codes because they don't add value at the moment
3 years ago
Daniel Karzel c9d492d155 Only wait for xmr-lock until t1 expired
3 years ago
Daniel Karzel 83ce6f2c85 Ensure that Bob can cancel correctly if T1 expired and Alice did not move
3 years ago
Daniel Karzel 8296490764
Merge pull request #111 from comit-network/trace-xmr-btc
3 years ago
Daniel Karzel 5f8b7f2624 Fix tracing subscribe filter for xmr-btc`
3 years ago
Franck Royer 40a27a2438
Remove dead code
3 years ago
Franck Royer df237f82cf
Fix clippy warning
3 years ago
Franck Royer 49b84d84b9
Add address at the start
3 years ago
Franck Royer 1e4b115556
Separate Bob restart tests
3 years ago
Franck Royer e366d3a73b
Join all futures to avoid hanging tests
3 years ago
Franck Royer 2abf65f3b6
Remove sleep that seems unnecessary
3 years ago
Franck Royer 4a4e23038b
Add logging to investigate add address race condition
3 years ago
Franck Royer 1a4bd0e2b4
Bob refunds swap after restart that requires communication
3 years ago
Franck Royer d9ea7ab605
Only carry the tx_lock_id instead of the full state
3 years ago
Franck Royer edfab58246
Scope alice db
3 years ago
Franck Royer dc96b3d1e9
Stop running first event loop after Alice restarts
3 years ago
Franck Royer 638143a10d
Replace hard coded port by dynamic available one
3 years ago
Franck Royer 2212758d17
Rename refund test as it is alice specific
3 years ago
bors[bot] 3db71997d3
Merge #99
3 years ago
bors[bot] 4f631c0c9b
Merge #98
3 years ago
bors[bot] 88c29dbce5
Merge #94
3 years ago
Daniel Karzel 4046305474
Merge pull request #88 from comit-network/resume-swap-cli
3 years ago
Daniel Karzel 20893c1bb1 Cleanup Display for database states
3 years ago
Daniel Karzel e6493784bf Change `pin_mut!` to `select!`
3 years ago
Daniel Karzel 773eebc723 Cleanup resume_from_database functions only used in tests
3 years ago
Daniel Karzel e9681b6e2b Work in review comments
3 years ago
Daniel Karzel 43d05935e7 Remove tor module
3 years ago
Daniel Karzel 093cbaa4b4 Introduce T1Expired state for Bob properly and check expiries in states after both locked
3 years ago
Daniel Karzel 6d03d1bbff Resume command and global database cl-parameter
3 years ago
Franck Royer 71cf501c29
Delete `bob::negotiate`
3 years ago
Franck Royer 19066200d1
Add a TODO to use existing helper functions
3 years ago
Franck Royer 84bec0631b
Rename alice::negotiate to steps
3 years ago
Franck Royer 53d13330c2
Remove dupe code
3 years ago
rishflab 9d266fc648 Add balance assertions to restart tests
3 years ago
Franck Royer 5ba830f3bf
Replace swap `recover` terminology with `resume`
3 years ago
Franck Royer 8cc470a80e
Use `-ed` terminology for cancel state
3 years ago
Daniel Karzel b83ab71669
Split up tests into separate files to overcome CI failure
3 years ago
Daniel Karzel 7cae6a9e4d
Add Bob restart test
3 years ago
Daniel Karzel 4ec2da29a0
Modularize Bob's test setup (separate init for state, event_loop)
3 years ago
Daniel Karzel 9a930af33f
Remove duplicated restart+refund test, move tests into separate files
3 years ago
Daniel Karzel 91d4d5da25
Cleanup swap execution to not return EventLoopHandle, refactor both_refund test
3 years ago
Daniel Karzel 3692046758
Bob's recover function
3 years ago
Daniel Karzel bf39c34ada
Alice restart and refund test if restarted before encsig learner
3 years ago
Daniel Karzel 8c929564ef
Refactor container initialization
3 years ago
rishflab 143d8bc07d
Move message0 response handler out of NB
3 years ago
Daniel Karzel 4143394767
Add recovery function for Alice
3 years ago
rishflab 4b00141c29
Fix happy path test
3 years ago
Franck Royer 7092af457a
Introduced DB for Alice & Bob
3 years ago
Franck Royer 4ce8695dfc
Align with origin/database
3 years ago
Franck Royer 1a5b9f9fa9
Update tests after rebase
3 years ago
Franck Royer c4cdd098fd
Use from instead of try_from for Alice state conversion
3 years ago
Franck Royer caf903acda
wip: Add test for when bob restarts
3 years ago
Franck Royer 905fc6cf35
Save Bob state during swap
3 years ago
Franck Royer 7e0a1ffe84
Remove generator for bob
3 years ago
Franck Royer c6af5eb9ac
Introduce test where alice restarts before all communications are done
3 years ago
Franck Royer 3580b7ed2c
Add test where Alice restart after encsign is learned
3 years ago
Franck Royer a22efaa7bc
Remove unneeded peer id argument
3 years ago
Franck Royer 9323f22009
Reorder calls
3 years ago
Franck Royer a24d1a49b9
Remove unneeded `as_ref_calls`
3 years ago
Franck Royer 1c7cc7ee46
Scope futures' instanciation
3 years ago
Franck Royer 6226e5789f
Introduce test where alice restart mid-swap
3 years ago
Franck Royer 71a0832ef4
Add zero const to monero::Amount
3 years ago
Franck Royer 64b021daf4
Save Alice states in db
3 years ago
Franck Royer 238f6a989d
Extract spend key as soon as possible
3 years ago
Franck Royer c095693a5f
Refund swap if resumed from a step that requires further communication
3 years ago
Franck Royer 11cea9ba69
Remove passing alice peer id
3 years ago
rishflab d8d6477ee9 Remove and fix comments
3 years ago
rishflab 082f4eb005 Use unused port in refund test
3 years ago
rishflab 7af4b6980a Test Alice refunds after Bob refund
3 years ago
rishflab 773390886b Test that Bob refunds if Alice fails to act
3 years ago
rishflab 78c6a1a78f Add Bob refund execution
3 years ago
rishflab f806ad7231 Assert balances after punish
3 years ago
bors[bot] 9fecf7008e
Merge #61
3 years ago
Daniel Karzel 03b8e5f52e Upgrade CLI for mainnet test
3 years ago
Daniel Karzel aad7a22f81 Utility function for initializing tracing for tests
3 years ago
Franck Royer c0478d7191
Move expiries to config
3 years ago
Franck Royer ef6e8fc723
Clean-up unused code
3 years ago
Franck Royer e71bf7d8e9
Add comment regarding processing in network behaviour
3 years ago
Franck Royer 2c9fb7b1da
Rename var to match type name
3 years ago
Franck Royer 91d28682ed
Remove comments
3 years ago
Franck Royer 53aae5cf5f
Use anyhow macro as intended
3 years ago
Franck Royer 51cc44484b
Remove unneeded pub qualifiers
3 years ago
rishflab 9ba89194b0 Rename swarm driver to event loop
3 years ago
rishflab f5d3d54b13 Prevent premature Bob t1 timeout
3 years ago
rishflab 27d1334726 Init Alice behaviour with state0
3 years ago
rishflab 3d8866f1a0 Convert event loop to use fused futures select
3 years ago
rishflab 58da1df9dc Create SwarmDriverHandle to resolve ownership issues
3 years ago
rishflab 6f7408ecce Drive swarm in seperate async task
3 years ago
rishflab f88ed9183b
Merge pull request #54 from comit-network/bob-unhappy-paths
3 years ago
rishflab bd8e6e36e0 Fix monero blocktime config
3 years ago
Daniel Karzel 1a2857af29 Properly init tracing per test and reverse the filter to be exclusive
3 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
Lucas Soriano del Pino ac2cfd7f65 Print swap history on --history flag
4 years ago
Lucas Soriano del Pino ecbfed9c11 Add Database API to fetch all swaps
4 years ago
Lucas Soriano del Pino f9cfc2abe3 Remove generics from Database
4 years ago
Lucas Soriano del Pino 02075c2a1d Support saving multiple swaps
4 years ago
Lucas Soriano del Pino 823add218e Remove temporary test tracing guards
4 years ago
Lucas Soriano del Pino a26890001b Fix swap e2e test
4 years ago
Lucas Soriano del Pino 934ddb366a Save state for Alice at specific points in the swap
4 years ago
rishflab ea08778b2f Save state for Bob at specific points in the swap
4 years ago
Philipp Hoenisch 981fcacc95
Make swap e2e test work with new monerod lib
4 years ago
Philipp Hoenisch 70d64f74ae
Testcontainers upgrade
4 years ago
Philipp Hoenisch 0b9e8c145e
Update xmr-btc lib to use new monero-harness
4 years ago
rishflab a44303f839 Add monerod to config
4 years ago
rishflab 7afd316210 Construct tor transport for Bob
4 years ago
rishflab 3b008c38a6 Remove redundant code and stale comments
4 years ago
rishflab 249f273d1b Remove stale comments
4 years ago
rishflab 5971ef1f28 Fix clippy warnings
4 years ago
rishflab 606c48c752 Format swap crate Cargo.toml
4 years ago
rishflab 796d0b3439 Extract transport creation and remove tor conditional compile
4 years ago
rishflab 0ca511bf8a Remove hardcoded configuration
4 years ago
Lucas Soriano del Pino 92c7e8e84f Run swap e2e test without tor feature
4 years ago
Lucas Soriano del Pino 792fa351c8 Upgrade bitcoin-harness dependency
4 years ago
Lucas Soriano del Pino 7fa7641feb Clean up some logs and comments
4 years ago
Tobin C. Harding 4d4acde476 Bubble up an event when Bob receives message 3 response
4 years ago
Lucas Soriano del Pino a37f43a1ba wip: Provide enough funds to both parties
4 years ago
Lucas Soriano del Pino eb6bbe6180 wip: Fix bug where bob was sending two amount request
4 years ago
Lucas Soriano del Pino 9f32cd988e wip: Use same timelock value for refund and punish
4 years ago
Lucas Soriano del Pino 62c4501926 wip: Add xmr_btc tracing filter
4 years ago
Lucas Soriano del Pino ae87c10cae wip: fixed message0
4 years ago
Tobin C. Harding 119f2a7c54 Add error logging to request_response
4 years ago
Tobin C. Harding b8ab4b4eee wip: add env filter
4 years ago
Tobin C. Harding 3e2f0b74a2 Do not trace events meant for other NBs
4 years ago
Tobin C. Harding c464555f5e Enable trace output
4 years ago
Tobin C. Harding 39f86154ce Use serde_cbor instead of serde_json
4 years ago
Tobin C. Harding 2bd4977fe4 Increase read buffer size
4 years ago
Lucas Soriano del Pino 9384b0cf3c [WIP] Swap app e2e test
4 years ago
Lucas Soriano del Pino 9e30bd5151 Generate addresses as late as possible
4 years ago
Lucas Soriano del Pino 3f43581da7 Implement traits Receive{BitcoinRedeemEncsig, TransferProof}
4 years ago
Lucas Soriano del Pino a4e4c27bee Execute Bob's on-chain protocol after handshake
4 years ago
Lucas Soriano del Pino 4ee82a5a2a Execute Alice's on-chain protocol after handshake
4 years ago
Philipp Hoenisch b8fd9a734f
Use full path imports for dependencies to reduce cfg hell
4 years ago
Tobin C. Harding a1351e5461 Do not declare 'port' variable
4 years ago
Tobin C. Harding 464b699426 Fail if user passes in local port for non-tor usage
4 years ago
Tobin C. Harding 42d194f758 Use fully qualified path for bail
4 years ago
Tobin C. Harding 5e35904101 Use an option for the local port
4 years ago
Philipp Hoenisch 8811a0a205
Add Tor to main
4 years ago
Lucas Soriano cf8accf30d
Merge pull request #28 from comit-network/re-work-swap-functions
4 years ago
Tobin C. Harding b22f265cf3 Send back an empty response to Message2
4 years ago
Tobin C. Harding 194a19cf1d Add todos
4 years ago
Tobin C. Harding 6be5d64c1c Remove stale, ugly, type conversion
4 years ago
Lucas Soriano 58aa2b5a2b
Merge pull request #23 from comit-network/remove-re-export
4 years ago
Tobin C. Harding 8f5a989ad1 Use 'amounts' for local varibale name
4 years ago
Tobin C. Harding b8130d23a6 Only break if Bob has requested amounts already
4 years ago
Tobin C. Harding 5da84a3d48
Merge pull request #25 from comit-network/unused-assigments
4 years ago
Lucas Soriano del Pino ba4ae09cd1 Remove allow(unused_assignments) attribute
4 years ago
Tobin C. Harding cbccc282ef Send Message2 from Bob to Alice
4 years ago
Lucas Soriano del Pino 0dd01c3a3b Do not re-export curve25519_dalek
4 years ago
rishflab ec71f98252 Revert re-imports to qualified paths
4 years ago
rishflab fea6b29da9 Test monero amount serialisation
4 years ago
Franck Royer 9ea708b2a5 Remove custom implementation of bitcoin amount serde
4 years ago
rishflab c781ee949d Move storage into application crate
4 years ago
Philipp Hoenisch 17b32fed90
Moving tor into swap
4 years ago
Tobin C. Harding 97363cb05c Fix build after merge
4 years ago
Tobin C. Harding 19f065575d Do a bunch of cleanups
4 years ago
Tobin C. Harding 6e34f9c978 Use const TIMEOUT instead of an argument
4 years ago
Tobin C. Harding cc61079826 Use VerifiedAmounts
4 years ago
Tobin C. Harding eed5e8e9a4 Move monero serde code to lib
4 years ago
Tobin C. Harding 30298bdf1f Do some more cleanups
4 years ago
Tobin C. Harding 2059158dad Bump to libp2p v29
4 years ago
Tobin C. Harding ad006fae6a Do a bunch of cleanups
4 years ago
Tobin C. Harding 0f17ec076c Add message1
4 years ago
Tobin C. Harding ad0d8d5713 Emit message0 out of NB (both parties)
4 years ago
Tobin C. Harding bb94643943 Remove data from message until Message0 impl serde
4 years ago
Tobin C. Harding e7504de76c Add state0 -> state1 messages
4 years ago
Tobin C. Harding 08ec776daa Move monero/bitcoin modules to files
4 years ago
Tobin C. Harding aaf1363c05 Refine peer tracker and amounts protocol
4 years ago
Tobin C. Harding 47eaa44f76 Remove unneeded From<Never> impl
4 years ago
Tobin C. Harding 40e97ffdc3 Add todo to check amounts calculation
4 years ago
Tobin C. Harding 1251681cfd Calculate amounts from BTC
4 years ago
Tobin C. Harding 3492c46e71 Verify amounts with user
4 years ago
Tobin C. Harding 05766d3146 Add swap/
4 years ago