From bcfbed71563d6d37801b34d58d478c5efc4abd96 Mon Sep 17 00:00:00 2001 From: bengo <171782+gobengo@users.noreply.github.com> Date: Thu, 21 Mar 2024 14:20:41 -0700 Subject: [PATCH] fix how tests builds string for W3_NFTSTORAGE_PRINCIPAL --- packages/api/src/utils/context.js | 5 +++++ packages/api/test/nfts-upload.spec.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/api/src/utils/context.js b/packages/api/src/utils/context.js index 1d122f1113..aa5dc82315 100644 --- a/packages/api/src/utils/context.js +++ b/packages/api/src/utils/context.js @@ -70,6 +70,11 @@ export async function getContext(event, params) { let w3up if (config.W3UP_URL) { + console.warn('in getContext', { + W3UP_URL: config.W3UP_URL, + W3_NFTSTORAGE_PRINCIPAL: config.W3_NFTSTORAGE_PRINCIPAL, + W3_NFTSTORAGE_PROOF: config.W3_NFTSTORAGE_PROOF, + }) w3up = await createW3upClientFromConfig({ url: config.W3UP_URL, principal: config.W3_NFTSTORAGE_PRINCIPAL ?? '', diff --git a/packages/api/test/nfts-upload.spec.js b/packages/api/test/nfts-upload.spec.js index c1ef8de7c0..5e20c4d252 100644 --- a/packages/api/test/nfts-upload.spec.js +++ b/packages/api/test/nfts-upload.spec.js @@ -44,7 +44,7 @@ test.before(async (t) => { LINKDEX_URL: linkdexUrl, W3UP_URL: (await mockW3up).url.toString(), W3_NFTSTORAGE_SPACE: (await nftStorageSpace).did(), - W3_NFTSTORAGE_PRINCIPAL: (await nftStorageApiPrincipal).did(), + W3_NFTSTORAGE_PRINCIPAL: ed25519.format(await nftStorageApiPrincipal), W3_NFTSTORAGE_PROOF: ( await encodeDelegationAsCid( await delegate({