Commit Graph

22 Commits (c900d125938242c2ddd03e0bf0f3c8ceaed569b7)

Author SHA1 Message Date
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
3 years ago
Franck Royer 2a778f5644
Remove overzealous clippy overrides
We have overridden a number of clippy warnings such as
"large enum variant".

Considering that we have a number of issues
 with the stack size in CI, it is more prudent to follow clippy's advice
 and box larger items so that the enum does not take larger space.

Do note that an instance of the enum always takes as much space as its
largest variant.
4 years ago
rishflab fcec465bdb Revert "No need to send Monero transfer proof from Alice to Bob" 4 years ago
Lucas Soriano del Pino 620216a596 Remove need to send Monero transfer proof from Alice to Bob 4 years ago
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).
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 39f86154ce Use serde_cbor instead of serde_json
We have serde trait implementations that use `serde_cbor` which is a superset of
josn. We cannot use `serder_json` to ser/deser these objects.
4 years ago
Tobin C. Harding 2bd4977fe4 Increase read buffer size
Our messages are quite big, increase the read buffer to 1 megabyte to
accommodate them.
4 years ago
Lucas Soriano del Pino a4e4c27bee Execute Bob's on-chain protocol after handshake
Co-authored-by: Tobin C. Harding <tobin@coblox.tech>
4 years ago
Lucas Soriano del Pino 4ee82a5a2a Execute Alice's on-chain protocol after handshake
Co-authored-by: Tobin C. Harding <tobin@coblox.tech>
4 years ago
Tobin C. Harding b22f265cf3 Send back an empty response to Message2
Alice does not respond with anything when receiving message 2 from Bob. We don't
want to leave Bob's request/response protocol waiting so send an empty response
back.
4 years ago
Tobin C. Harding cbccc282ef Send Message2 from Bob to Alice
In order for Alice to complete the handshake she needs to transition to state 3,
for this she needs message 2 from Bob.

Send `bob::Message2` to Alice and transition to `State3` - completing the
handshake.
4 years ago
Tobin C. Harding 30298bdf1f Do some more cleanups 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 05766d3146 Add swap/
Add a binary crate `swap` that implements two nodes (Alice and Bob). With this
applied we can start up a node for each role and do:

- Bob: Requests current amounts using BTC is input
- Alice: Responds with amounts
- Bob: (mock) get user input to Ok the amounts

... continue with swap (TODO)
4 years ago