Skip to content

Commit

Permalink
Do not call same functons twice
Browse files Browse the repository at this point in the history
  • Loading branch information
wojciech-turek committed Sep 6, 2024
1 parent fac4d77 commit 88bc154
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/marketplace/contracts/TransferManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,17 @@ abstract contract TransferManager is Initializable, ITransferManager {
DealSide memory paymentSide,
DealSide memory nftSide
) internal pure returns (address paymentSideRecipient, address nftSideRecipient) {
if (LibAsset.decodeRecipient(paymentSide.asset.assetType) != address(0)) {
paymentSideRecipient = LibAsset.decodeRecipient(paymentSide.asset.assetType);
address decodedPaymentSideRecipient = LibAsset.decodeRecipient(paymentSide.asset.assetType);
address decodedNftSideRecipient = LibAsset.decodeRecipient(nftSide.asset.assetType);

if (decodedPaymentSideRecipient != address(0)) {
paymentSideRecipient = decodedPaymentSideRecipient;
} else {
paymentSideRecipient = paymentSide.account;
}

if (LibAsset.decodeRecipient(nftSide.asset.assetType) != address(0)) {
nftSideRecipient = LibAsset.decodeRecipient(nftSide.asset.assetType);
if (decodedNftSideRecipient != address(0)) {
nftSideRecipient = decodedNftSideRecipient;
} else {
nftSideRecipient = nftSide.account;
}
Expand Down

1 comment on commit 88bc154

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage for this commit

96.08%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
packages/marketplace/contracts
   Exchange.sol95.52%96.43%93.75%95.65%172, 63
   ExchangeCore.sol98.84%96.67%100%100%82
   OrderValidator.sol89.36%81.82%100%95.24%34, 78–79, 79, 82
   RoyaltiesRegistry.sol96.21%88.24%100%98.77%183, 205–206, 252, 63
   TransferManager.sol93.57%86.36%100%96.39%151–152, 157–158, 177, 180, 275, 279, 81
   Whitelist.sol75.81%60%85.71%82.14%103, 107–108, 121, 124, 140–141, 53, 65, 65–66, 70, 75
packages/marketplace/contracts/interfaces
   IOrderValidator.sol100%100%100%100%
   IRoyaltiesProvider.sol100%100%100%100%
   ITransferManager.sol100%100%100%100%
   IWhitelist.sol100%100%100%100%
packages/marketplace/contracts/libraries
   LibAsset.sol93.18%92.86%100%91.30%113, 115–116
   LibMath.sol100%100%100%100%
   LibOrder.sol100%100%100%100%

Please sign in to comment.