From a2cb435398305614094579546d68bcc0537e8158 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 17 Jan 2022 16:30:54 +0100 Subject: [PATCH 1/2] Fix import IPFS files --- libs/remix-url-resolver/src/resolve.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-url-resolver/src/resolve.ts b/libs/remix-url-resolver/src/resolve.ts index 38076686a2..c139bbc803 100644 --- a/libs/remix-url-resolver/src/resolve.ts +++ b/libs/remix-url-resolver/src/resolve.ts @@ -117,7 +117,7 @@ export class RemixURLResolver { // If you don't find greeter.sol on ipfs gateway use local // const req = 'http://localhost:8080/' + url const response: AxiosResponse = await axios.get(req) - return { content: response.data, cleanUrl: url } + return { content: response.data, cleanUrl: url.replace('ipfs/', '') } } catch (e) { throw e } From 321b18ccafc20f6ba8a50cd79368e7f484fb9d1b Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 17 Jan 2022 16:41:59 +0100 Subject: [PATCH 2/2] fix test --- libs/remix-url-resolver/tests/test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-url-resolver/tests/test.ts b/libs/remix-url-resolver/tests/test.ts index f47144e6be..d87101689c 100644 --- a/libs/remix-url-resolver/tests/test.ts +++ b/libs/remix-url-resolver/tests/test.ts @@ -260,7 +260,7 @@ describe('testRunner', () => { const content = fs.readFileSync(__dirname + '/example_1/greeter.sol', { encoding: 'utf8'}) const expt: object = { content: content, - cleanUrl: 'ipfs/QmcuCKyokk9Z6f65ADAADNiS2R2xCjfRkv7mYBSWDwtA7M', + cleanUrl: 'QmcuCKyokk9Z6f65ADAADNiS2R2xCjfRkv7mYBSWDwtA7M', type: 'ipfs' } assert.deepEqual(results, expt)