Skip to content

Commit

Permalink
Revert "Testing some stuff"
Browse files Browse the repository at this point in the history
This reverts commit 3d5ca20.
  • Loading branch information
pokkst committed Oct 20, 2023
1 parent 3d5ca20 commit 6d4e158
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions monero-harness/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,21 +319,21 @@ impl<'c> MoneroWalletRpc {
}

pub async fn balance(&self) -> Result<u64> {
self.client().refresh(None).await?;
self.client().refresh().await?;
let balance = self.client().get_balance(0).await?.balance;

Ok(balance)
}

pub async fn unlocked_balance(&self) -> Result<u64> {
self.client().refresh(None).await?;
self.client().refresh().await?;
let balance = self.client().get_balance(0).await?.unlocked_balance;

Ok(balance)
}

pub async fn refresh(&self) -> Result<Refreshed> {
Ok(self.client().refresh(None).await?)
Ok(self.client().refresh().await?)
}
}

Expand Down
2 changes: 1 addition & 1 deletion monero-rpc/src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub trait MoneroWalletRpc {
password: String,
autosave_current: bool,
) -> GenerateFromKeys;
async fn refresh(&self, start_height: Option<u32>) -> Refreshed;
async fn refresh(&self) -> Refreshed;
async fn sweep_all(&self, address: String) -> SweepAll;
async fn get_version(&self) -> Version;
async fn store(&self);
Expand Down
2 changes: 1 addition & 1 deletion swap/src/bin/asb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ async fn init_monero_wallet(
env_config,
)
.await?;
let _ = wallet.refresh(None).await?;
let _ = wallet.refresh().await?;
wallet.store().await?;
Ok(wallet)
}
Expand Down
6 changes: 3 additions & 3 deletions swap/src/monero/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ impl Wallet {
};

// Try to send all the funds from the generated wallet to the default wallet
match wallet.refresh(Some(restore_height.height)).await {
match wallet.refresh().await {
Ok(_) => match wallet.sweep_all(self.main_address.to_string()).await {
Ok(sweep_all) => {
for tx in sweep_all.tx_hash_list {
Expand Down Expand Up @@ -284,8 +284,8 @@ impl Wallet {
self.main_address
}

pub async fn refresh(&self, start_height: Option<u32>) -> Result<Refreshed> {
Ok(self.inner.lock().await.refresh(start_height).await?)
pub async fn refresh(&self) -> Result<Refreshed> {
Ok(self.inner.lock().await.refresh().await?)
}
}

Expand Down
2 changes: 1 addition & 1 deletion swap/src/protocol/bob/swap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ async fn next_state(
}

// Ensure that the generated wallet is synced so we have a proper balance
monero_wallet.refresh(Some(state.monero_wallet_restore_blockheight.height)).await?;
monero_wallet.refresh().await?;
// Sweep (transfer all funds) to the given address
let tx_hashes = monero_wallet.sweep_all(monero_receive_address).await?;

Expand Down

0 comments on commit 6d4e158

Please sign in to comment.