Skip to content

Commit

Permalink
minor improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
RaaCT0R committed Jul 24, 2024
1 parent e049f3d commit a269d1a
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions packages/chains/evm/lib/EvmChain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,18 +185,14 @@ abstract class EvmChain extends AbstractChain<Transaction> {

// check the balance in the lock address
const requiredAssets: AssetBalance = orders.reduce(
(sum: AssetBalance, order: SinglePayment) => {
const wrappedBalance = ChainUtils.sumAssetBalance(sum, order.assets);
// TODO: is it okay to do this? other chains use wrapped value in requiredAssets
return ChainUtils.unwrapAssetBalance(
wrappedBalance,
this.tokenMap,
(sum: AssetBalance, order: SinglePayment) =>
ChainUtils.sumAssetBalance(sum, order.assets),
{
nativeToken: this.tokenMap.wrapAmount(
this.NATIVE_TOKEN_ID,
totalGas * gasPrice,
this.CHAIN
);
},
{
nativeToken: totalGas * gasPrice,
).amount,
tokens: [],
}
);
Expand Down

0 comments on commit a269d1a

Please sign in to comment.