Skip to content

Commit

Permalink
fix snapshot gate test
Browse files Browse the repository at this point in the history
  • Loading branch information
zajck committed Nov 8, 2023
1 parent eef7bb1 commit 505d526
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/example/SnapshotGateTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ describe("SnapshotGate", function () {
let offer, offers, otherSellerOfferId;
let offerDates, offerDurations;
let snapshot, snapshotTokenSupplies, snapshotTokenCount, holders, holderByAddress;
let bosonErrors;

beforeEach(async function () {
// Reset the accountId iterator
Expand Down Expand Up @@ -177,6 +178,8 @@ describe("SnapshotGate", function () {
// Cast Diamond to IBosonExchangeHandler
exchangeHandler = await getContractAt("IBosonExchangeHandler", await protocolDiamond.getAddress());

bosonErrors = await getContractAt("BosonErrors", await protocolDiamond.getAddress());

accountId.next(true);

// Deploy the SnapshotGate example
Expand Down Expand Up @@ -716,7 +719,7 @@ describe("SnapshotGate", function () {
// Commit to the offer
await expect(
snapshotGate.connect(holder).commitToGatedOffer(entry.owner, offerId, entry.tokenId, { value: price })
).to.revertedWith(RevertReasons.TOKEN_ID_NOT_IN_CONDITION_RANGE);
).to.revertedWithCustomError(bosonErrors, RevertReasons.TOKEN_ID_NOT_IN_CONDITION_RANGE);
});

it("offer is from another seller", async function () {
Expand Down Expand Up @@ -920,7 +923,7 @@ describe("SnapshotGate", function () {
// Check that holder cannot commit directly to the offer on the protocol itself
await expect(
exchangeHandler.connect(holder).commitToConditionalOffer(await holder.getAddress(), offerId, entry.tokenId)
).to.revertedWith(RevertReasons.CANNOT_COMMIT);
).to.revertedWithCustomError(bosonErrors, RevertReasons.CANNOT_COMMIT);
});
});
});
Expand Down

0 comments on commit 505d526

Please sign in to comment.