-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
this addresses most of the feedback: - fail to start if w3up client principal is not passed - move function to test helpers - make w3up service DID configurable
- Loading branch information
Showing
6 changed files
with
66 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,21 +29,26 @@ import { createCarCid } from '../src/utils/car.js' | |
import { createServer } from 'node:http' | ||
import { ed25519 } from '@ucanto/principal' | ||
import { delegate } from '@ucanto/core' | ||
import { encodeDelegationAsCid } from '../src/utils/w3up.js' | ||
import { base64 } from 'multiformats/bases/base64' | ||
import { createMockW3up, locate } from './utils/w3up-testing.js' | ||
import { | ||
createMockW3up, | ||
locate, | ||
encodeDelegationAsCid, | ||
} from './utils/w3up-testing.js' | ||
|
||
const __dirname = path.dirname(fileURLToPath(import.meta.url)) | ||
|
||
const nftStorageSpace = ed25519.generate() | ||
const nftStorageApiPrincipal = ed25519.generate() | ||
const nftStorageAccountEmailAllowListedForW3up = '[email protected]' | ||
const mockW3upDID = 'did:web:test.web3.storage' | ||
let mockW3upStoreAddCount = 0 | ||
let mockW3upUploadAddCount = 0 | ||
const mockW3up = Promise.resolve( | ||
(async function () { | ||
const server = createServer( | ||
await createMockW3up({ | ||
did: mockW3upDID, | ||
async onHandleStoreAdd(invocation) { | ||
mockW3upStoreAddCount++ | ||
}, | ||
|
@@ -68,6 +73,7 @@ test.before(async (t) => { | |
overrides: { | ||
LINKDEX_URL: linkdexUrl, | ||
W3UP_URL: locate((await mockW3up).server).url.toString(), | ||
W3UP_DID: mockW3upDID, | ||
W3_NFTSTORAGE_SPACE: (await nftStorageSpace).did(), | ||
W3_NFTSTORAGE_PRINCIPAL: ed25519.format(await nftStorageApiPrincipal), | ||
W3_NFTSTORAGE_PROOF: ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters