Skip to content

Commit

Permalink
move up
Browse files Browse the repository at this point in the history
  • Loading branch information
thibault-martinez committed Jan 16, 2024
1 parent 8479a5c commit 0cee21d
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions sdk/src/wallet/operations/transaction/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,6 @@ where
where
crate::wallet::Error: From<S::Error>,
{
let wallet_data = self.data().await;
let implicit_account_data = wallet_data
.unspent_outputs
.get(output_id)
.ok_or(Error::ImplicitAccountNotFound)?;
let implicit_account = if implicit_account_data.output.is_implicit_account() {
implicit_account_data.output.as_basic()
} else {
return Err(Error::ImplicitAccountNotFound);
};

let key_source = match key_source.map(Into::into) {
Some(key_source) => key_source,
None => self.bip_path().await.ok_or(Error::MissingBipPath)?.into(),
Expand All @@ -83,6 +72,17 @@ where
}
};

let wallet_data = self.data().await;
let implicit_account_data = wallet_data
.unspent_outputs
.get(output_id)
.ok_or(Error::ImplicitAccountNotFound)?;
let implicit_account = if implicit_account_data.output.is_implicit_account() {
implicit_account_data.output.as_basic()
} else {
return Err(Error::ImplicitAccountNotFound);
};

let account_id = AccountId::from(output_id);
let account = AccountOutput::build_with_amount(implicit_account.amount(), account_id)
.with_mana(implicit_account_data.output.available_mana(
Expand Down

0 comments on commit 0cee21d

Please sign in to comment.