Skip to content

Commit

Permalink
logs
Browse files Browse the repository at this point in the history
  • Loading branch information
anajuliabit committed Aug 3, 2023
1 parent 8b66743 commit 7868d2f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion contracts/protocol/facets/ExchangeHandlerFacet.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.18;

import "hardhat/console.sol";
import { IBosonExchangeHandler } from "../../interfaces/handlers/IBosonExchangeHandler.sol";
import { IBosonAccountHandler } from "../../interfaces/handlers/IBosonAccountHandler.sol";
import { IBosonVoucher } from "../../interfaces/clients/IBosonVoucher.sol";
Expand Down Expand Up @@ -869,6 +869,8 @@ contract ExchangeHandlerFacet is IBosonExchangeHandler, BuyerBase, DisputeBase {
(success, result) = twin.tokenAddress.call{ gas: gasleft() - reservedGas }(data);

success = success && (result.length == 0 || abi.decode(result, (bool)));
// log result
console.log(string(abi.encodePacked("Result: ", result)));
}
}

Expand All @@ -877,6 +879,11 @@ contract ExchangeHandlerFacet is IBosonExchangeHandler, BuyerBase, DisputeBase {

// If token transfer failed
if (!success) {
console.log("Transfer failed for twin %s", tokenId);
console.log(twin.tokenAddress);
console.log(uint8(twin.tokenType);
console.log(twin.amount);
// log error returned
raiseDisputeInternal(_exchange, _voucher, seller.id);

emit TwinTransferFailed(twin.id, twin.tokenAddress, _exchange.id, tokenId, twin.amount, sender);
Expand Down
2 changes: 2 additions & 0 deletions test/util/upgrade.js
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@ async function populateProtocolContract(

// create bundle with all seller's twins and offers
const bundle = new Bundle(bundleId, seller.seller.id, seller.offerIds, twinIds);
console.log(bundle);
await bundleHandler.connect(seller.wallet).createBundle(bundle);
bundles.push(bundle);
bundleId++;
Expand Down Expand Up @@ -672,6 +673,7 @@ async function populateProtocolContract(
.connect(buyerWallet)
.commitToConditionalOffer(await buyerWallet.getAddress(), offer.id, condition.tokenId, { value: msgValue });
} else {
console.log(offer.id);
await exchangeHandler
.connect(buyerWallet)
.commitToOffer(await buyerWallet.getAddress(), offer.id, { value: msgValue });
Expand Down

0 comments on commit 7868d2f

Please sign in to comment.