From 7b35ed14e8906ef032932d17b79e50f146076eda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8r=E2=88=82=C2=A1?= Date: Fri, 13 Oct 2023 13:40:16 +0100 Subject: [PATCH] Adapting the client --- .../contracts/test/integration-testing/deployment.ts | 2 +- .../test/integration-testing/space-setup.ts | 2 +- packages/contracts/utils/ipfs.ts | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/contracts/test/integration-testing/deployment.ts b/packages/contracts/test/integration-testing/deployment.ts index 8203ce7..e1f6f48 100644 --- a/packages/contracts/test/integration-testing/deployment.ts +++ b/packages/contracts/test/integration-testing/deployment.ts @@ -115,7 +115,7 @@ describe("PluginRepo Deployment", function () { switch (pluginSetupParams.PLUGIN_SETUP_CONTRACT_NAME) { case SpacePluginSetupParams.PLUGIN_SETUP_CONTRACT_NAME: expect(receivedStriMetadata).to.equal( - "ipfs://QmdEAfaFb6iYW4UKE7cnkY3DD3uXdSe2ZnRExjJRbJSfNN", + "ipfs://QmcAUbh4UmhwZp4b7aQf9nkpemhCfTVms2eSVng1bZUmmo", ); break; diff --git a/packages/contracts/test/integration-testing/space-setup.ts b/packages/contracts/test/integration-testing/space-setup.ts index d01bd29..734f575 100644 --- a/packages/contracts/test/integration-testing/space-setup.ts +++ b/packages/contracts/test/integration-testing/space-setup.ts @@ -113,7 +113,7 @@ describe("SpacePluginSetup processing", function () { .prepareInstallation .inputs, ), - [toHex("ipfs://1234"), pluginUpgrader], + [toHex("ipfs://1234"), ADDRESS_ZERO, pluginUpgrader], ); const results = await installPlugin(psp, dao, pluginSetupRef, data); diff --git a/packages/contracts/utils/ipfs.ts b/packages/contracts/utils/ipfs.ts index fa0b311..0ebcf06 100644 --- a/packages/contracts/utils/ipfs.ts +++ b/packages/contracts/utils/ipfs.ts @@ -1,4 +1,4 @@ -import { BytesLike, ethers } from "ethers"; +import { ethers } from "ethers"; import IPFS from "ipfs-http-client"; export async function uploadToIPFS( @@ -7,16 +7,16 @@ export async function uploadToIPFS( ): Promise { const client = IPFS.create({ url: testing - ? "https://testing-ipfs-0.aragon.network/api/v0" - : "https://ipfs-0.aragon.network/api/v0", + ? "https://test.ipfs.aragon.network/api/v0" + : "https://prod.ipfs.aragon.network/api/v0", headers: { "X-API-KEY": "b477RhECf8s8sdM7XrkLBs2wHc4kCMwpbcFC55Kt", }, }); - const cid = await client.add(content); - await client.pin.add(cid.cid); - return cid.path; + const result = await client.add(content); + await client.pin.add(result.cid); + return result.path || result.cid.toString(); } export function toHex(input: string): string {