From 36613763277a78bfb609e2748bcaeabbff6d6053 Mon Sep 17 00:00:00 2001 From: Eric <5089238+emizzle@users.noreply.github.com> Date: Fri, 6 Jun 2025 05:42:01 +1000 Subject: [PATCH] fix(integration): fixes hardhat not recognising custom error (#243) Co-authored-by: Dmitriy Ryajov --- contracts/Marketplace.sol | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contracts/Marketplace.sol b/contracts/Marketplace.sol index a0b4f50..8b0a29c 100644 --- a/contracts/Marketplace.sol +++ b/contracts/Marketplace.sol @@ -544,7 +544,11 @@ contract Marketplace is SlotReservations, Proofs, StateRetrieval, Endian { function getActiveSlot( SlotId slotId - ) public view slotIsNotFree(slotId) returns (ActiveSlot memory) { + ) public view returns (ActiveSlot memory) { + // Modifier `slotIsNotFree(slotId)` works here, but using the modifier + // causes hardhat to return an error "reverted with an unrecognized custom + // error (return data: 0x8b41ec7f)". + if (_slots[slotId].state == SlotState.Free) revert Marketplace_SlotIsFree(); Slot storage slot = _slots[slotId]; ActiveSlot memory activeSlot; activeSlot.request = _requests[slot.requestId];