diff --git a/src/services/evm/erc721_media_handler.ts b/src/services/evm/erc721_media_handler.ts index d02cc5362..da9d250ac 100644 --- a/src/services/evm/erc721_media_handler.ts +++ b/src/services/evm/erc721_media_handler.ts @@ -189,7 +189,7 @@ export async function downloadAttachment(url: string) { maxBodyLength: parseInt(MAX_BODY_LENGTH_BYTE, 10), }); const fromGithub = url.includes('//github.com'); - const formatedUrl = fromGithub ? `${url }?raw=true` : url; + const formatedUrl = fromGithub ? `${url}?raw=true` : url; return axiosClient.get(formatedUrl).then((response: any) => { const buffer = Buffer.from(response.data, 'base64'); return buffer; @@ -213,9 +213,10 @@ export function parseFilename(media_uri: string) { return parsed.host + parsed.path; // http://bafybeie5gq4jxvzmsym6hjlwxej4rwdoxt7wadqvmmwbqi7r27fclha2va.ipfs.dweb.link/1.jpg } return parsed.path.substring(1); // http://ipfs.io/ipfs/QmWov9DpE1vYZtTH7JLKXb7b8bJycN91rEPJEmXRXdmh2G/nerd_access_pass.gif - } + } + if (media_uri.includes('//github.com')) { return parsed.path.substring(1); // https://github.com/storyprotocol/protocol-core/blob/main/assets/license-image.gif - + } } if (media_uri.startsWith('/ipfs/')) { return media_uri.substring(1); // /ipfs/QmPAGifcMvxDBgYr1XmEz9gZiC3DEkfYeinFdVSe364uQp/689.png diff --git a/test/unit/services/erc721/erc721_handler.spec.ts b/test/unit/services/erc721/erc721_handler.spec.ts index c0d946133..6c5a752a6 100644 --- a/test/unit/services/erc721/erc721_handler.spec.ts +++ b/test/unit/services/erc721/erc721_handler.spec.ts @@ -50,6 +50,7 @@ export default class Erc721HandlerTest { tx_msg_id: 222, tx_id: 223, index: 1, + from: hexToBytes('0x51aeade652867f342ddc012e15c27d0cd6220398'), }); erc721Contract1 = Erc721Contract.fromJson({ diff --git a/test/unit/services/evm/erc20_reindex.spec.ts b/test/unit/services/evm/erc20_reindex.spec.ts index 00a7281d0..9b28e5f93 100644 --- a/test/unit/services/evm/erc20_reindex.spec.ts +++ b/test/unit/services/evm/erc20_reindex.spec.ts @@ -119,6 +119,7 @@ const evmTransaction = EVMTransaction.fromJson({ tx_msg_id: 4752908, contract_address: null, index: 0, + from: hexToBytes('0x51aeade652867f342ddc012e15c27d0cd6220398'), }); @Describe('Test erc20 reindex')