Commit Graph

741 Commits (0c616c74379d572a343dead39cb5dfd5b38d03b7)

Author SHA1 Message Date
Thomas Eizinger 05849505b1
Inline `wait_for_bitcoin_refund`
3 years ago
Thomas Eizinger 8c9285f1f9
Inline step function because it has been reduced to a single statement
3 years ago
Thomas Eizinger afb7e816a1
Don't wait for confirmations again
3 years ago
Thomas Eizinger c92f2dbc77
Move more domain knowledge onto the `TxCancel` type
3 years ago
Thomas Eizinger 75aec95b0c
Introduce monero::TransferRequest
3 years ago
Thomas Eizinger d682433ec9
Move `EventLoopHandle` next to its impl block
3 years ago
Thomas Eizinger e77f1729b4
Move `extract_monero_private_key` onto TxRefund
3 years ago
Thomas Eizinger a1e065b4e7
Simplify racing cancel timelock against learning enc-sig
3 years ago
Thomas Eizinger 575893fb51
Use domain types in fn signature instead of messages
3 years ago
Thomas Eizinger 64b71d0b16
Remove unnecessary pinning
3 years ago
Daniel Karzel 105e291e67 Update the application name for `--version` print
3 years ago
bors[bot] 2c385ee7d9
Merge #321
3 years ago
bors[bot] 113f2fa385
Merge #322
3 years ago
bors[bot] fc28609a96
Merge #323 #324
3 years ago
Thomas Eizinger e54d26b26c
Improve log messages by including PeerId
3 years ago
Thomas Eizinger a57f88d1b4
Properly handle concurrent messages to and from peers
3 years ago
Thomas Eizinger ce78075932
Make Monero and Bitcoin wallet use a generalized sync interval
3 years ago
Thomas Eizinger 09c41f89c4
Rename ExecutionParams to EnvironmentConfig
3 years ago
Thomas Eizinger bc43ed6ebd
Pass execution params directly into wallet for initialization
3 years ago
Thomas Eizinger 7213907a79
Group bitcoin and monero fields together
3 years ago
bors[bot] 95acbc6277
Merge #307
3 years ago
rishflab 8675d88727 Don't wait for tx lock confirmed after broadcast
3 years ago
rishflab f5e6ba18e0 Use different address for redeem and punish
3 years ago
bors[bot] 345bc5b316
Merge #320
3 years ago
bors[bot] 9ed5ca9a04
Merge #317
3 years ago
Thomas Eizinger 9e3a104b42
Disable timestamp if we log to a non-interactive terminal
3 years ago
Thomas Eizinger edb8851ce2
Fix env filter for asb
3 years ago
Thomas Eizinger 273cf15631
Introduce `Watchable` abstraction for Bitcoin wallet
3 years ago
Thomas Eizinger a0830f099f
Pass relevant execution params into wallet instead of via functions
3 years ago
Thomas Eizinger 84ea092a1b
Remove unnecessary state variables by constructing TXs on demand
3 years ago
rishflab e5c0158597
Greatly reduce load onto the Electrum backend
3 years ago
Thomas Eizinger e17cbadccb
Don't add signatures to transaction unless necessary
3 years ago
Thomas Eizinger 6beb732e35
Eliminate `build_bitcoin_punish_transaction`
3 years ago
Daniel Karzel ea05c306e0 Alice spawns swaps outside the event loop
3 years ago
Thomas Eizinger dd6c66a594
Move completing of Bitcoin redeem tx onto RedeemTx
3 years ago
rishflab 21429f24b2
Inline wait_for_locked_bitcoin() that is only called once
3 years ago
rishflab 6a3e4802f1
Remove redundant reference
3 years ago
rishflab 458a8d594a
Rename fn param to correctly reflect underlying type
3 years ago
Thomas Eizinger 2704245ed5
Fix monero refresh interval
3 years ago
Daniel Karzel 0091b6cdaf Remove CLI config file in favour of parameters
3 years ago
bors[bot] 009597ac49
Merge #306
3 years ago
Daniel Karzel be52892e65
Monero wallet should not know about all execution params
3 years ago
Thomas Eizinger 82738b111e
Refactor `monero::Wallet::watch_for_transfer` to not use `backoff`
3 years ago
Thomas Eizinger 7e0c44ad1d
Add avg monero block time to execution params
3 years ago
Thomas Eizinger d560e69203
Make durations more readable by using extension methods from `time`
3 years ago
Thomas Eizinger ecff1d1cbe
Remove indirection of constants
3 years ago
Thomas Eizinger bac0f11898
Disable `backoff`s `max_elapsed_time` functionality
3 years ago
Thomas Eizinger 9ad2160c69
Refactor the kraken module to automatically re-connect on errors
3 years ago
Thomas Eizinger c560b3b21a
Introduce `RateUpdate` type alias to reduce duplication
3 years ago
Thomas Eizinger fd5b38739a
Remove constant in favor of inlining string
3 years ago
Thomas Eizinger 142e5e2d3a
Use tracing macros by fully-qualifying them
3 years ago
bors[bot] cc131ecf60
Merge #293
3 years ago
Thomas Eizinger 08923a14f3
Simplify GET request for block tip height
3 years ago
Thomas Eizinger e9d7d9299c
Simplify the GET request to the tx status URL
3 years ago
Thomas Eizinger 418ad7089d
Make tests more readable by following arrange-act-assert
3 years ago
Thomas Eizinger c2329b19a2
Tell the user more about the monero lock transaction
3 years ago
Thomas Eizinger 13c4d29d40
Tell the user immediately how many confirmations we expect
3 years ago
Thomas Eizinger 4883e23dd8
Tell the user for how many confirmations we are waiting
3 years ago
Thomas Eizinger 5d4cf40831
Fix comparison of Monero confirmations
3 years ago
rishflab f92a8ac300 Improve CLI help comments and "type" hints
3 years ago
Daniel Karzel 196557b377 Rename binary to swap
3 years ago
Daniel Karzel f8b61e2e0e Make monero daemon host configurable
3 years ago
Daniel Karzel f091402c7a Remove parameter duplication by introducing structs
3 years ago
Thomas Eizinger c826a28911
Add context if we fail to compute extended private key
3 years ago
Thomas Eizinger 1aa6d177bf
Improve error messages when determining BTC amount to be swapped
3 years ago
Thomas Eizinger 4138039ea0
Make sure all error messages start with an uppercase letter
3 years ago
Thomas Eizinger 816e8b9b96
Add more context to fallible functions inside bitcoin::Wallet
3 years ago
Thomas Eizinger 5c24a46298
Improve error message if stuff fails directly in main
3 years ago
Thomas Eizinger 37f97ac471
Shorten function name
3 years ago
Thomas Eizinger 4f66269887
Move error message on sync _into_ the function
3 years ago
Thomas Eizinger 5953037b81
Don't repeat the module name within the type
3 years ago
Thomas Eizinger 87f928f56c
Move const to function where it is used
3 years ago
Thomas Eizinger 4642e6c0e3
Simplify arguments to `init_XYZ_wallet` functions
3 years ago
Thomas Eizinger d0db6cba10
Favour individual logs over one in main
3 years ago
bors[bot] 2041f367c6
Merge #288
3 years ago
rishflab 754159c9f8 Switch to public stagenet node that works
3 years ago
Thomas Eizinger b178e95f95
Redo layout of eventloop module
3 years ago
Thomas Eizinger 1822886cd0
Provide stronger isolation of kraken module
3 years ago
Thomas Eizinger f6ed4d65b5
Properly deal with additional messages sent from kraken
3 years ago
Thomas Eizinger 7575d412b8
Add kraken_ticker CLI for local testing of the client
3 years ago
Thomas Eizinger 60d6d50246
Extract kraken websocket client into dedicated module
3 years ago
bors[bot] 20f2e56e2d
Merge #271
3 years ago
Daniel Karzel 47a31760c0 Bob can verify the Monero txs by tx-hash
3 years ago
Thomas Eizinger 14dcd150af
Extract `determine_btc_to_swap` function and test it
3 years ago
Thomas Eizinger 601bf07255
Introduce `quote` protocol and display it to the user before they fund
3 years ago
Thomas Eizinger 3da01ea44a
Rename local variables according to new protocol name
3 years ago
Thomas Eizinger ead5db3f45
Re-order fields to group them semantically
3 years ago
Thomas Eizinger bc176bc4fb
Minor import optimizations
3 years ago
Thomas Eizinger 6d9b21cb47
Change `imports_granularity` to module
3 years ago
Thomas Eizinger 2c8200621d
Move `pub use` into pub use block
3 years ago
bors[bot] d1363d130c
Merge #265
3 years ago
Daniel Karzel 7504c6ceee Context for monero address parsing errors
3 years ago
Daniel Karzel 35d0e246d8 Monero address network check
3 years ago
bors[bot] cba9f119b6
Merge #261
3 years ago
Daniel Karzel 2e3c2d8edf Remove Arcs in favour of references
3 years ago
Daniel Karzel 5d807e9647 Reorder: Move utility functionality to bottom
3 years ago
Daniel Karzel 862c29f1a8 Reorder: Move sweep_all after transfer
3 years ago
Daniel Karzel 5a43b3453e Reorder: Move create after open
3 years ago
Daniel Karzel b17e6cbd94 Reorder: Move open to top
3 years ago
Daniel Karzel d63790c2a6 Remove unnecessary monero wallet trait abstractions
3 years ago
Daniel Karzel 1041212a60 Work in review comments
3 years ago
Daniel Karzel 66c8401c95 Sweep all from generated wallet to user wallet
3 years ago
Thomas Eizinger 7042ed9441
Replace quote with spot-price protocol
3 years ago
Daniel Karzel 9f53dab3c6 Harmonize names to make more sense
3 years ago
Daniel Karzel 70494fcb4f Create means creating the current wallet
3 years ago
Daniel Karzel 5b798217bc Open means opening the current wallet
3 years ago
Thomas Eizinger 2440964385
Allow ASB to be configured with max BTC buy amount
3 years ago
Thomas Eizinger ce077a3ff5
Decouple Bob's EventLoop from the builder
3 years ago
Thomas Eizinger 54bc91581f
Don't unnecessarily create async blocks
3 years ago
Thomas Eizinger a4c25080b6
Merge network::Seed into crate::Seed
3 years ago
Thomas Eizinger 089ac0806e
Simplify constructor of Bob's EventLoop
3 years ago
Daniel Karzel 1b167f3eb6 Cleanup swap initialization for Alice and Bob
3 years ago
bors[bot] a8ebd4d16e
Merge #259
3 years ago
rishflab a41b255dab Upgrade bitcoin wallet to use BIP84 derivation scheme
3 years ago
rishflab bcdde021eb Add windows support to monero rpc installer
3 years ago
rishflab 27df9128be Bail if monero wallet rpc is not found in downloaded archive
3 years ago
Thomas Eizinger 3ad9516188
Reduce logging when signing transactions
3 years ago
Thomas Eizinger 8c9b087e39
Unify logging of broadcasted transactions
3 years ago
Thomas Eizinger 3a503bf95f
Shorten function name
3 years ago
Thomas Eizinger 45cff81ea5
Remove traits in favor of using the wallet struct directly
3 years ago
Thomas Eizinger 8c0df23647
Only show _log_ output if the user passes `--debug`
3 years ago
Thomas Eizinger cb4e2c041b
Rename `opt` to `args`
3 years ago
Thomas Eizinger f4827e3fa4
Improve time formatting of log output
3 years ago
Thomas Eizinger a82e82edd5
Tell the user about the monero-wallet-rpc download
3 years ago
Thomas Eizinger 06e3bccaa6
Don't print PeerId when requesting quote
3 years ago
Thomas Eizinger cbef577e2d
Inform user that we are going to swap the remainder of the balance
3 years ago
Thomas Eizinger b7c3524b4f
Abort the eventloop if the dialling fails
3 years ago
Thomas Eizinger 4e9e186462
Don't log things the user doesn't care about
3 years ago
Thomas Eizinger 6b74761e34
Remove tracing context
3 years ago
Thomas Eizinger 3d2d447fba
Improve error message
3 years ago
Thomas Eizinger bbbe5f7ae8
Demote / promote log messages to their appropriate level
3 years ago
Thomas Eizinger 7387884e6d
Move log messages to the appropriate abstraction layer
3 years ago
Thomas Eizinger b8df4a3145
Inline tracing configuration for swap_cli
3 years ago
Thomas Eizinger a0e7c6ecf7
Don't Arc the AtomicU32
3 years ago
Thomas Eizinger 40dcf0355a
Simplify `Transfer::transfer` return type
3 years ago
bors[bot] 1de3fa486e
Merge #247
3 years ago
Thomas Eizinger 9f0b1c5cbe
Calculate max_giveable based on spending script size
3 years ago
Daniel Karzel 8c40ee1da4 Change anyhow! to bail! in error scenarios
3 years ago
bors[bot] 7251588e79
Merge #233
3 years ago
bors[bot] 5ddf41721e
Merge #238
3 years ago
rishflab 975d604405 Test to ensure default alice peer id and multi addr is valid
3 years ago
rishflab 9a82b572ec Default to buy xmr using default trait
3 years ago
rishflab d6d67f62f1 Swap cli executes BuyXmr path if subcommand is not given
3 years ago
rishflab 60de6a9219 Remove intermediate structs in cli arguments
3 years ago
bors[bot] 9a32f7d405
Merge #236
3 years ago
Daniel Karzel bb1537d6f2 Error feedback for the user upon communication errors
3 years ago
Daniel Karzel 019d6c725a Maximum sell amount for ASB that defaults to 0.5 XMR
3 years ago
bors[bot] bb0377c6c7
Merge #232
3 years ago
Daniel Karzel e66e84085b Rename Bob's Behavior Failure to CommunicationError
3 years ago
Thomas Eizinger f472070546
Remove `--send-btc` in favor of swapping the available balance
3 years ago
Thomas Eizinger 32cb0eb896
Rename `build_tx_lock_psbt` to `send_to_address`
3 years ago
Thomas Eizinger 67fe01a2ef
Remove `BuildTxLockPsbt` and `GetNetwork` traits
3 years ago
Thomas Eizinger 6c38d66864
Remove `Tx` arguments from `add_signatures` functions
3 years ago
Thomas Eizinger 0f8fbd087f
Make all fields of `bitcoin::Wallet` private
3 years ago
Thomas Eizinger 1876d17ba4
Remove `map_err` in favor of `?`
3 years ago
Thomas Eizinger 7d324d966a
Remove `syncing` wallet log
3 years ago
bors[bot] 93d59398af
Merge #231
3 years ago
Daniel Karzel 1f1b3a95bc Logging for different scenarios when reading from rate stream
3 years ago
rishflab abc9aaa327 Use default alice peer id and multiaddr if not specified in cli args
3 years ago
Daniel Karzel cad6a1c3a7 ABS only sends quote response if sufficient XMR balance
3 years ago
rishflab f52567155a Use default testnet config if config file path not specified
3 years ago
Daniel Karzel fc2c08c7c9 Error only on close message when fetching the rate
3 years ago
rishflab 51c16f23d8
Download and run monero wallet rpc on swap cli startup
3 years ago
Daniel Karzel 0945cee459 Remove traits in favour of public functions
3 years ago
Daniel Karzel 578d23d7fc Proper encapsulation of wallet boundaries through private fields
3 years ago
Daniel Karzel 947bcb6192 ASB reloads the default wallet after generate_from_keys atomically
3 years ago
Daniel Karzel 684cbe4d0b Remember monero wallet-height for Alice's refund scenario
3 years ago
Daniel Karzel fa04775188 Rename function explicit to cancellation to cancel
3 years ago
Daniel Karzel 1404057dbe Remove misleading TODO
3 years ago
Daniel Karzel 9f1deb9fdc Wrap the Monero wallet client in a Mutex
3 years ago
Daniel Karzel aed8358fb7 Remove dead code
3 years ago
bors[bot] 2654879ff3
Merge #218
3 years ago
bors[bot] fb2057453a
Merge #219 #221
3 years ago
Thomas Eizinger 66db8e1851
Remove unnecessary log dependency
3 years ago
Thomas Eizinger 03078f328c
Split monero-harness into harness and rpc
3 years ago
rishflab 8280072400 Fix/improve comment explaining TxRefund encsigning
3 years ago
Daniel Karzel 151f33ba10 Rename variables to add to understanding the code
3 years ago
bors[bot] 61a8282be1
Merge #203
3 years ago
Daniel Karzel b4ceee49df Change monitoring to default wallet
3 years ago
Daniel Karzel 9496dce917 Skip heartbeat messages
3 years ago
Thomas Eizinger a8bfc1d686 Make LatestRate::Error require std::error::Error trait bound
3 years ago
Thomas Eizinger b47b06aa23 Import anyhow::Result across the codebase
3 years ago
Franck Royer 519d1a5701 Log rate and amounts for Alice when doing execution setup
3 years ago
Franck Royer 644f4c1732 Bubble up ws error to consumer
3 years ago
Franck Royer 92b3df4158 Introduce dynamic rates
3 years ago
bors[bot] a6724f29af
Merge #214
3 years ago
bors[bot] 81228c9d5b
Merge #209
3 years ago
Daniel Karzel fe3d6f1fef Rename nectar to asb (automated swap backend)
3 years ago
Daniel Karzel 164de3c524 Properly calculate the confirmations for Bitcoin tx
3 years ago
Thomas Eizinger 2d8ede80e1
Use released version of backoff
3 years ago
Thomas Eizinger cabf0efb8c
Only construct proof system once
3 years ago
Thomas Eizinger 84bc2c82b7
Upgrade to bdk 4.0
3 years ago
bors[bot] b3f49cf83e
Merge #200
3 years ago
bors[bot] 8537b88a68
Merge #201
3 years ago
Daniel Karzel babd1d7b60
Wait for refund if insufficient Monero is locked up
3 years ago
Daniel Karzel ebb869e6f4 Distinguish transient and permanent Electrum errors
3 years ago
Daniel Karzel 9b93cabfdf Use context instead of map_error
3 years ago
rishflab fe362d765b Add sync wallet on nectar's startup
3 years ago
rishflab 00e2b257c4 Remove misplaced sync wallet call
3 years ago
Daniel Karzel 2ced9ddba4 Prevent future from being stopped by calling forget on handle
3 years ago