Commit Graph

1230 Commits (master)

Author SHA1 Message Date
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
We don't want Bob to be able to crash us by sending an out of
order message. Only break if Bob has not requested amounts.
4 years ago
Tobin C. Harding 5da84a3d48
Merge pull request #25 from comit-network/unused-assigments
Remove allow(unused_assignments) attribute
4 years ago
Lucas Soriano del Pino ba4ae09cd1 Remove allow(unused_assignments) attribute
It looks like the compiler can ascertain that `message0` will be
initialised by the time we use it, so it doesn't need to be an
`Option` and it doesn't need to be declared as mutable.
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
Lucas Soriano del Pino 0dd01c3a3b Do not re-export curve25519_dalek
Anything that needs to be re-exported by this crate from
`curve25519_dalek` can be re-exported from the `monero` module. In
fact, the `Scalar` type was already being re-exported.
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
This is unnecessary as rust-bitcoin provides it.
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
We model the getting of amounts as a network behaviour even though conceptually
it is a protocol. Refine/refactor the code a bit to make this more obvious.

- Use `Amounts` instead of `Messenger`

We only ever connect to a single peer, update peer tracker to reflect this. This
is a single patch because the handling of the two network behaviours is a
intertwined.

- Only track one peer connection
- Track the peer id and the multiaddr of the counterparty
- Emit an event for connection established on Alice's side as well as Bob's side
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/
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