Commit Graph

28 Commits

Author SHA1 Message Date
Daniel Karzel
862c29f1a8 Reorder: Move sweep_all after transfer 2021-03-03 17:15:37 +11:00
Daniel Karzel
5a43b3453e Reorder: Move create after open 2021-03-03 17:15:37 +11:00
Daniel Karzel
b17e6cbd94 Reorder: Move open to top 2021-03-03 17:15:37 +11:00
Daniel Karzel
d63790c2a6 Remove unnecessary monero wallet trait abstractions 2021-03-03 17:15:37 +11:00
Daniel Karzel
1041212a60 Work in review comments 2021-03-03 17:15:37 +11:00
Daniel Karzel
66c8401c95 Sweep all from generated wallet to user wallet
The default implementation for the command was removed because it does not
add additional value if we have a mandatory parameter anyway.
2021-03-03 17:15:37 +11:00
Daniel Karzel
9f53dab3c6 Harmonize names to make more sense
The wallet is an instance of a wallet that has a name.
When we use `CreateWalletForOutputThenReloadWallet` we actually unload the wallet.
It would be cleaner to create a new instance that does that swap, but I did not go that far.
2021-03-03 17:03:34 +11:00
Daniel Karzel
70494fcb4f Create means creating the current wallet 2021-03-03 17:03:34 +11:00
Daniel Karzel
5b798217bc Open means opening the current wallet 2021-03-03 17:03:33 +11:00
Thomas Eizinger
bbbe5f7ae8
Demote / promote log messages to their appropriate level 2021-03-02 09:49:53 +11:00
Thomas Eizinger
a0e7c6ecf7
Don't Arc the AtomicU32
We never clone this type, there is no need to wrap it in an `Arc`.
2021-03-02 09:49:33 +11:00
Thomas Eizinger
40dcf0355a
Simplify Transfer::transfer return type
We never use the fee returned from this function, remove it.
2021-03-02 09:49:30 +11:00
Daniel Karzel
cad6a1c3a7 ABS only sends quote response if sufficient XMR balance 2021-02-26 11:12:32 +11:00
Daniel Karzel
0945cee459 Remove traits in favour of public functions 2021-02-25 10:34:22 +11:00
Daniel Karzel
578d23d7fc Proper encapsulation of wallet boundaries through private fields 2021-02-25 10:30:24 +11:00
Daniel Karzel
947bcb6192 ASB reloads the default wallet after generate_from_keys atomically 2021-02-25 00:34:05 +11:00
Daniel Karzel
684cbe4d0b Remember monero wallet-height for Alice's refund scenario 2021-02-25 00:34:05 +11:00
Daniel Karzel
9f1deb9fdc Wrap the Monero wallet client in a Mutex
In order to ensure that we can atomically generate_from_keys and then reload a wallet,
we have to wrap the client of the monero wallet RPC inside a mutex.
When introducing the Mutex I noticed that several inner RPC calls were leaking to the
swap crate monero wallet. As this is a violation of boundaries I introduced the traits
`GetAddress`, `WalletBlockHeight` and `Refresh`.

Note that the monero wallet could potentially know its own public view key and
public spend key. If we refactor the wallet to include this information upon wallet
creation we can also generate addresses using `monero::Address::standard`.
2021-02-25 00:33:58 +11:00
Thomas Eizinger
03078f328c
Split monero-harness into harness and rpc
This allows us to move `monero-harness` and `bitcoin-harness` into
`[dev-dependencies]` of `swap`.
2021-02-23 14:30:20 +11:00
Thomas Eizinger
2d8ede80e1
Use released version of backoff 2021-02-19 15:18:40 +11:00
Daniel Karzel
dac4443bbd Add functionality to open monero wallet through rpc 2021-02-09 16:34:50 +11:00
Daniel Karzel
62605a318a Add CreateWallet trait to expose create_wallet 2021-02-09 16:34:50 +11:00
rishflab
77fc5743a2
Upgrade tokio to 1.0
Upgrade bitcoin harness dependency to latest commit

Upgrade backoff to fix failing tests. The previous version of backoff had a broken version of the retry function. Upgraded to a newer comit which fixes this problem.

Upgrade hyper to 0.14 as the 0.13 was bringing in tokio 0.2.24

Upgraded bitcoin harness to version that uses tokio 1.0 and reqwest 0.11

Upgrade reqwest to 0.11. Reqwest 0.11 uses tokio 1.0

Upgrade libp2p to 0.34 in preparation for tokio 1.0 upgrade
2021-01-29 11:36:10 +11:00
Daniel Karzel
44c4b5dcea Remove newlines from import statements to avoid problems
Rust fmt automatically groups the imports (from top to bottom) as `pub use` `use crate` and `use`.
There is no need to introduce sections which cause annoyance when auto importing using the IDE.
2021-01-21 19:10:51 +11:00
Daniel Karzel
d4316f0cfe Print each monero confirmation for Bob
This is to provide more context to the user.
2021-01-18 14:50:59 +11:00
Daniel Karzel
af45206fde Remember the block-height before XMR lock for generated monero wallet restore height
Speeds up wallet creation, because only the blocks after the recorded height will be scanned.
2021-01-12 13:18:49 +11:00
rishflab
e7c00d742e Re-export bitcoin and monero types 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