Commit Graph

847 Commits (ab4c98678cdd77d1abc4f9539fec40e7563e1852)
 

Author SHA1 Message Date
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 194a19cf1d Add todos 4 years ago
Tobin C. Harding 6be5d64c1c Remove stale, ugly, type conversion 4 years ago
Lucas Soriano 4cfc603786
Merge pull request #26 from comit-network/more-on-chain-tests
Test that Alice punishes if Bob is inactive after locking bitcoin
4 years ago
Lucas Soriano 58aa2b5a2b
Merge pull request #23 from comit-network/remove-re-export
Do not re-export curve25519_dalek
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
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
Tobin C. Harding 36ba504129
Merge pull request #24 from comit-network/alice-state-3
Send Message2 from Bob to Alice
4 years ago
Lucas Soriano del Pino 24104d5d35 Test that Alice punishes if Bob is inactive after locking bitcoin 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 90f6c55290
Merge pull request #22 from comit-network/on-chain-tests
Test that both parties refund if Alice does not redeem
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
Lucas Soriano del Pino cea1af1e1a Take bitcoin_tx_lock_timeout as argument to action generators 4 years ago
Lucas Soriano del Pino 1d21ae7e7a Use pin_mut! instead of futures::pin_mut! 4 years ago
Lucas Soriano del Pino aa2a20916e Include Bob being inactive as a reason for failure 4 years ago
Lucas Soriano del Pino 41e8c7283c Verify Bob's redeem encsig as Alice
Not doing so means that receiving an invalid encrypted signature from
Bob would make the generator produce a `RedeemBtc` action that should
not be accepted by the node (since Bob's signature would be invalid
after decrypting his encrypted signature).

It's better to fail early and let the user know what went wrong,
rather than let them hit an incomprehensible error when using their
wallet.
4 years ago
Lucas Soriano del Pino def3399d1c Use while instead of loop 4 years ago
Lucas Soriano del Pino c86a82b315 Rename action_generator_alice to action_generator 4 years ago
Lucas Soriano del Pino e84c56378c Test that both parties refund if Alice does not redeem
Also:

- Move generator functions to `alice` and `bob` modules. This makes
using `tracing` a lot easier, since the context of the file name let's
us differentiate between Alice's and Bob's generator logs more
clearly.
- Accept 0 confirmations when watching for the Monero lock
transaction. This should eventually be configured by the application,
but in the tests it's making things unexpectedly slower.
4 years ago
rishflab 964640154d
Merge pull request #18 from comit-network/db-dupe-code
Improve serde implementations
4 years ago
rishflab ec71f98252 Revert re-imports to qualified paths 4 years ago
rishflab fea6b29da9 Test monero amount serialisation 4 years ago
rishflab 28ffe063b7 Remove stale comment 4 years ago
Franck Royer 82b092d86e Use consensus encoding for monero private key
Using consensus encoding future proof the library by using a commonly
accepted de/serialization format.
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 3b14a0e4b3
Merge pull request #21 from comit-network/integrate-db
Move storage into application crate
4 years ago
rishflab c781ee949d Move storage into application crate 4 years ago
Philipp Hoenisch 11a4a7563b
Merge pull request #19 from comit-network/move-tor
Moving tor into swap
4 years ago
Philipp Hoenisch 17b32fed90
Moving tor into swap 4 years ago
Philipp Hoenisch da5b4bef75
Merge pull request #20 from comit-network/monero-harness-ports
Use lib to ensure ports are free
4 years ago
Philipp Hoenisch c0109d12cd
Use lib to ensure ports are free 4 years ago
rishflab f7bcfa5e14
Merge pull request #14 from comit-network/db
Save and recover protocol state from disk
4 years ago
rishflab a29786e175 Use external serialisation implementation 4 years ago
rishflab 03dee7a3ea Generate temp dir for db 4 years ago
rishflab 3e82211a82 Add database todos 4 years ago
rishflab 62bc3c0432 Fix rebase conflicts 4 years ago
rishflab e3b68a3864 Improve database type safety
The database is now bound to a type eg. alice::State or bob::State.
The caller cannot expect to retrieve a type that is different to
the type that was stored.
4 years ago
rishflab 8eda051087 Remove redundant serialisation implementation
ECDSAfun's serialisation implementation was already imported
making the custom implementation redundant

Remove remnants of stale comment

Remove redundant conversion

Rename params to be consistent
4 years ago
Tobin C. Harding 71e09413aa
Merge pull request #12 from comit-network/on-chain-protocol 4 years ago
Tobin C. Harding 79c6c8bbef Sort Cargo.toml lines 4 years ago
Tobin C. Harding ade0e08db6 Merge branch 'master' into on-chain-protocol 4 years ago
Tobin C. Harding 97363cb05c Fix build after merge 4 years ago
Tobin C. Harding f8adf6d7e0 Merge branch 'on-chain-protocol' of github.com:comit-network/xmr-btc-swap into on-chain-protocol 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