Skip to content

Commit

Permalink
fix: early user tests (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
leosayous21 authored Sep 20, 2022
1 parent 778c8bd commit ff93c78
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions test/e2e/e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,12 @@ describe('Test E2E Protocol', () => {
[proofRequest1, proofRequest2]
);
const { events } = await tx.wait();
const args = getEventArgs(events, 'EarlyUserAttestationGenerated');

expect(args.destination).to.eql(request1.destination);
const earlyUserActivated = Date.now() < Date.parse('15 Sept 2022 00:00:00 GMT');
if (earlyUserActivated) {
const args = getEventArgs(events, 'EarlyUserAttestationGenerated');
expect(args.destination).to.eql(request1.destination);
}

const attestationsValues = await attestationsRegistry.getAttestationValueBatch(
[
Expand All @@ -270,7 +273,7 @@ describe('Test E2E Protocol', () => {
const expectedAttestationsValues = [
attestationsRequested1[0].value,
attestationsRequested2[0].value,
BigNumber.from(1),
earlyUserActivated ? BigNumber.from(1) : BigNumber.from(0),
];

expect(attestationsValues).to.be.eql(expectedAttestationsValues);
Expand Down Expand Up @@ -325,9 +328,11 @@ describe('Test E2E Protocol', () => {
);
await front.generateAttestations(hydraS1SoulboundAttester.address, request2, proofRequest2);
const { events } = await tx.wait();
const args = getEventArgs(events, 'EarlyUserAttestationGenerated');

expect(args.destination).to.eql(request1.destination);
const earlyUserActivated = Date.now() < Date.parse('15 Sept 2022 00:00:00 GMT');
if (earlyUserActivated) {
const args = getEventArgs(events, 'EarlyUserAttestationGenerated');
expect(args.destination).to.eql(request1.destination);
}

const attestationsValues = await attestationsRegistry.getAttestationValueBatch(
[
Expand All @@ -341,7 +346,7 @@ describe('Test E2E Protocol', () => {
const expectedAttestationsValues = [
attestationsRequested1[0].value,
attestationsRequested2[0].value,
BigNumber.from(1),
earlyUserActivated ? BigNumber.from(1) : BigNumber.from(0),
];

expect(attestationsValues).to.be.eql(expectedAttestationsValues);
Expand Down

0 comments on commit ff93c78

Please sign in to comment.