Skip to content

Commit

Permalink
Disable highlight & fix some other tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismaddern committed Oct 1, 2024
1 parent ad87d27 commit f5a41ec
Show file tree
Hide file tree
Showing 6 changed files with 216 additions and 199 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ Today, Mobile Minting supports the following creator platforms:
Base
</td>
<td>
💥 Failing
</td>
<td>
💥 Failing
</td>
<td>
💥 Failing
</td>
</tr>
<tr>
Expand Down
50 changes: 26 additions & 24 deletions src/ingestors/highlight/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,34 @@ const CONTRACT_ADDRESS = '0x8087039152c472Fa74F47398628fF002994056EA';

export class HighlightIngestor implements MintIngestor {
async supportsUrl(resources: MintIngestorResources, url: string): Promise<boolean> {
const id = url.split('/').pop();
if (!id) {
return false;
}

const collection = await getHighlightCollectionById(resources, id);

if (!collection || collection.chainId !== 8453) {
return false;
}

const urlPattern = /^https:\/\/highlight\.xyz\/mint\/[a-f0-9]{24}$/;
return (
new URL(url).hostname === 'www.highlight.xyz' || new URL(url).hostname === 'highlight.xyz' || urlPattern.test(url)
);
return false;
// const id = url.split('/').pop();
// if (!id) {
// return false;
// }

// const collection = await getHighlightCollectionById(resources, id);

// if (!collection || collection.chainId !== 8453) {
// return false;
// }

// const urlPattern = /^https:\/\/highlight\.xyz\/mint\/[a-f0-9]{24}$/;
// return (
// new URL(url).hostname === 'www.highlight.xyz' || new URL(url).hostname === 'highlight.xyz' || urlPattern.test(url)
// );
}

async supportsContract(resources: MintIngestorResources, contractOptions: MintContractOptions): Promise<boolean> {
if (contractOptions.chainId !== 8453) {
return false;
}
const collection = await getHighlightCollectionByAddress(resources, contractOptions);
if (!collection) {
return false;
}
return true;
return false;
// if (contractOptions.chainId !== 8453) {
// return false;
// }
// const collection = await getHighlightCollectionByAddress(resources, contractOptions);
// if (!collection) {
// return false;
// }
// return true;
}

async createMintForContract(
Expand Down Expand Up @@ -80,7 +82,7 @@ export class HighlightIngestor implements MintIngestor {
throw new MintIngestorError(MintIngestionErrorName.MissingRequiredData, 'Error finding creator');
}

const collectionId = collection.highlightCollection?.id;
const collectionId = collection.highlightCollection?.id || collection.id;

if (!collectionId) {
throw new MintIngestorError(MintIngestionErrorName.MissingRequiredData, 'Collection id not available');
Expand Down
1 change: 0 additions & 1 deletion src/ingestors/highlight/offchain-metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export const getHighlightCollectionById = async (
marketplaceId
accountId
address
symbol
chainId
status
baseUri
Expand Down
4 changes: 3 additions & 1 deletion test/ingestors/foundation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ describe('foundation', function () {
expect(mintInstructions.contractParams).to.equal(
'["0x89E63F58da71E9CD4DA439C3D1194917c67eb869", 1, address, "0x0000000000000000000000000000000000000000"]',
);
expect(mintInstructions.priceWei).to.equal('7700000000000000');

// This has now ended and the API returns 0 for the price
expect(mintInstructions.priceWei).to.equal('0');

expect(template.featuredImageUrl).to.equal(
'https://f8n-production-collection-assets.imgix.net/8453/0x89E63F58da71E9CD4DA439C3D1194917c67eb869/pre_reveal/nft.jpg',
Expand Down
2 changes: 1 addition & 1 deletion test/ingestors/highlight.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { basicIngestorTests } from '../shared/basic-ingestor-tests';

const resources = mintIngestorResources();

describe('highlight', function () {
describe.skip('highlight', function () {
basicIngestorTests(
new HighlightIngestor(),
resources,
Expand Down
Loading

0 comments on commit f5a41ec

Please sign in to comment.