Skip to content

Commit

Permalink
fix: use only base asset amount when calculating fee (#1240)
Browse files Browse the repository at this point in the history
Resolves the issue #1239
  • Loading branch information
mpoplavkov committed Dec 18, 2023
1 parent f74e9bb commit 6959712
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/fuels-accounts/src/account.rs
Expand Up @@ -213,7 +213,10 @@ pub trait Account: ViewOnlyAccount {
ScriptTransactionBuilder::prepare_transfer(inputs, outputs, tx_policies);

self.add_witnessses(&mut tx_builder);
self.adjust_for_fee(&mut tx_builder, amount).await?;

let used_base_amount = if asset_id == AssetId::BASE { amount } else { 0 };
self.adjust_for_fee(&mut tx_builder, used_base_amount)
.await?;

let tx = tx_builder.build(provider).await?;
let tx_id = provider.send_transaction_and_await_commit(tx).await?;
Expand Down

0 comments on commit 6959712

Please sign in to comment.