Commit Graph

51 Commits

Author SHA1 Message Date
Franck Royer
fb3b2aa546
Remove unnecessary pub qualifier 2021-02-15 16:20:34 +11:00
Franck Royer
ee43125bdd
Add nectar binary 2021-02-11 15:24:38 +11:00
Franck Royer
7805a6d684
Move cli specific modules under cli folder
nectar will also have its own folder with a separate config.
2021-02-11 10:34:44 +11:00
Franck Royer
7d392c3086
This files contains Command and Arguments structs 2021-02-11 09:47:42 +11:00
Franck Royer
788445964a
Move main.rs to cli.rs to prepare for nectar binary 2021-02-10 16:42:51 +11:00
Daniel Karzel
89b3775e05 Rename config to execution_params 2021-01-29 17:27:50 +11:00
Daniel Karzel
802dc61e7e Configuration for RPC urls and Bitcoin wallet name 2021-01-29 17:21:19 +11:00
Franck Royer
33db688e3a
Bob peer id can be retrieved from the DB
This remove branches where Alice resumes from the DB but cannot contact
Bob.
2021-01-22 17:19:20 +11:00
Franck Royer
f2a25ee49b
Move definitions out of lib.rs 2021-01-22 09:00:46 +11:00
Franck Royer
b88a777bae
Remove dead code 2021-01-22 08:59:09 +11:00
Daniel Karzel
433704e48c Top to bottom pub mod then mod then pub use then use (incl. use crate and use self) 2021-01-21 19:10:51 +11:00
Franck Royer
898b8bf8b0
Remove dead code 2021-01-21 12:27:32 +11:00
Franck Royer
31c63f0c4d
Remove dead code 2021-01-14 11:40:34 +11:00
Daniel Karzel
0a21040e08 Deterministic peer id from seed for alice
This includes the introduction of the --data-dir parameter instead of the --database.
Both the seed file and the database are stored in the data-dir, the database in sub-folder `database`.
2021-01-11 12:00:48 +11:00
rishflab
f64eede5d8 Move monero ser/deser to monero module 2021-01-08 12:34:36 +11:00
rishflab
c900d12593 Merge xmr_btc crate
Created network, storage and protocol modules. Organised
files into the modules where the belong.

xmr_btc crate moved into isolated modulein swap crate.

Remove the xmr_btc module and integrate into swap crate.

Consolidate message related code

Reorganise imports

Remove unused parent Message enum

Remove unused parent State enum

Remove unused dependencies from Cargo.toml
2021-01-08 12:34:33 +11:00
Franck Royer
b410de01df
Move state.rs under database module
The types in state are only used for the database
2020-12-23 15:20:24 +11:00
Franck Royer
8c7964bfee
Rename storage.rs to database.rs to reduce terminology variants 2020-12-23 15:17:27 +11:00
Franck Royer
cdf2800fa5
Align clippy lints
Lints in `main.rs` are not used if there is a `lib.rs` file.
2020-12-23 14:33:29 +11:00
Franck Royer
40a27a2438
Remove dead code 2020-12-22 13:50:36 +11:00
Daniel Karzel
43d05935e7 Remove tor module 2020-12-17 18:50:15 +11:00
rishflab
4b00141c29
Fix happy path test 2020-12-15 11:40:36 +11:00
Franck Royer
905fc6cf35
Save Bob state during swap 2020-12-15 10:18:46 +11:00
Daniel Karzel
03b8e5f52e Upgrade CLI for mainnet test 2020-12-11 14:46:29 +11:00
Franck Royer
c0478d7191
Move expiries to config
So they can be different for mainnet and regtest
2020-12-10 14:43:17 +11:00
rishflab
f5d3d54b13 Prevent premature Bob t1 timeout
Bob was hitting the t1 timeout and entering cancel
instead of redeem. This was resolved by increasing
the timeouts to 50.
2020-12-10 13:29:53 +11:00
rishflab
24631d464d Add test for recursive executor 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
58ca33dd04 Remove warnings 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
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
28225f8643 Implement swap recover function for Alice
This introduces a lot of duplication between the binary and the
library, but it's okay because this module should only be a temporary
measure until we allow recovery to be handled by the original state
machine.

Also, fix a bug in `xmr_btc::alice::action_generator` caused by the
incorrect assumption that Alice's ability to punish Bob could be
determined before the cancel transaction hits the blockchain.
2020-11-12 13:49:07 +11:00
Lucas Soriano del Pino
33a111d879 Move Swap state out of storage 2020-11-12 13:49:07 +11:00
rishflab
249f273d1b Remove stale comments 2020-11-03 15:13:25 +11:00
rishflab
796d0b3439 Extract transport creation and remove tor conditional compile
The numerous tor conditional compile flags were removed by
extracting transport creation to the main statement. A tor
transport is created if Alice specifies a tor port using the CLI.
2020-11-03 15:12:52 +11:00
Lucas Soriano del Pino
a37f43a1ba wip: Provide enough funds to both parties
Also use cosntant backoff retry strategy as opposed to exponential
backoff. This is in case retrying several times quickly causes the
retry intervals to become large enough that the test is very slow
and/or the Bitcoin lock transaction expires.

The current problem occurs on the last message i.e. Bob sending
tx_redeem_encsig to Alice. The action is yielded for Bob to do it, but
Alice appears to never receive it (unconfirmed claim, requires more
logging).
2020-10-30 14:07:15 +11:00
Lucas Soriano del Pino
9f32cd988e wip: Use same timelock value for refund and punish 2020-10-30 14:05:45 +11:00
Lucas Soriano del Pino
4ee82a5a2a Execute Alice's on-chain protocol after handshake
Co-authored-by: Tobin C. Harding <tobin@coblox.tech>
2020-10-30 14:00:39 +11:00
rishflab
c781ee949d Move storage into application crate 2020-10-26 10:32:54 +11:00
Philipp Hoenisch
17b32fed90
Moving tor into swap 2020-10-23 12:47:52 +11:00
Tobin C. Harding
cc61079826 Use VerifiedAmounts 2020-10-22 13:55:50 +11:00
Tobin C. Harding
eed5e8e9a4 Move monero serde code to lib 2020-10-22 13:54:13 +11:00
Tobin C. Harding
ad006fae6a Do a bunch of cleanups 2020-10-22 13:35:55 +11:00
Tobin C. Harding
e7504de76c Add state0 -> state1 messages 2020-10-21 15:02:52 +11:00
Tobin C. Harding
08ec776daa Move monero/bitcoin modules to files 2020-10-21 13:13:01 +11:00
Tobin C. Harding
1251681cfd Calculate amounts from BTC 2020-10-16 12:42:47 +11:00
Tobin C. Harding
3492c46e71 Verify amounts with user 2020-10-16 10:49:19 +11:00