Skip to content

Commit

Permalink
fix: test
Browse files Browse the repository at this point in the history
  • Loading branch information
phamphong9981 committed Sep 10, 2024
1 parent 61df2a4 commit 057845f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/services/evm/erc721_media_handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions test/unit/services/erc721/erc721_handler.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export default class Erc721HandlerTest {
tx_msg_id: 222,
tx_id: 223,
index: 1,
from: hexToBytes('0x51aeade652867f342ddc012e15c27d0cd6220398'),
});

erc721Contract1 = Erc721Contract.fromJson({
Expand Down
1 change: 1 addition & 0 deletions test/unit/services/evm/erc20_reindex.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ const evmTransaction = EVMTransaction.fromJson({
tx_msg_id: 4752908,
contract_address: null,
index: 0,
from: hexToBytes('0x51aeade652867f342ddc012e15c27d0cd6220398'),
});

@Describe('Test erc20 reindex')
Expand Down

0 comments on commit 057845f

Please sign in to comment.