Skip to content

Commit

Permalink
Revert "chore: revert "chore: update catalyst storage #140" (#143)"
Browse files Browse the repository at this point in the history
This reverts commit d94ead1
  • Loading branch information
Mariano Goldman committed Jul 24, 2023
1 parent 23651aa commit ee9b601
Show file tree
Hide file tree
Showing 11 changed files with 428 additions and 205 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@aws-sdk/client-sns": "^3.369.0",
"@dcl/catalyst-contracts": "^4.0.6",
"@dcl/catalyst-storage": "^2.0.4",
"@dcl/catalyst-storage": "^3.0.1",
"@dcl/crypto": "^3.4.3",
"@dcl/hashing": "^2.0.0",
"@dcl/protocol": "^1.0.0-5557204664.commit-964ab88",
Expand All @@ -25,7 +25,6 @@
"@well-known-components/logger": "^3.1.2",
"@well-known-components/metrics": "^2.0.1",
"@well-known-components/thegraph-component": "^1.5.0",
"aws-sdk": "^2.1262.0",
"busboy": "^1.6.0",
"decentraland-crypto-middleware": "^1.1.0",
"eth-connect": "^6.2.0",
Expand Down
4 changes: 2 additions & 2 deletions src/adapters/worlds-indexer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AppComponents, IWorldsIndexer, WorldData, WorldsIndex } from '../types'
import { bufferToStream, streamToBuffer } from '@dcl/catalyst-storage/dist/content-item'
import { bufferToStream, streamToBuffer } from '@dcl/catalyst-storage'
import { stringToUtf8Bytes } from 'eth-connect'
import { ContentMapping } from '@dcl/schemas/dist/misc/content-mapping'
import PQueue from 'p-queue'
Expand Down Expand Up @@ -76,7 +76,7 @@ export async function createWorldsIndexerComponent({
index = await createIndex()
} else {
index = JSON.parse((await streamToBuffer(await content.asStream())).toString())
// if older than 10 minutes create a new one
// if older than 10 minutes, create a new one
if (Date.now() - index.timestamp > 10 * 60 * 1000) {
index = await createIndex()
}
Expand Down
2 changes: 1 addition & 1 deletion src/adapters/worlds-manager.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AppComponents, IWorldsManager, WorldMetadata } from '../types'
import LRU from 'lru-cache'
import { bufferToStream, streamToBuffer } from '@dcl/catalyst-storage/dist/content-item'
import { bufferToStream, streamToBuffer } from '@dcl/catalyst-storage'
import { Entity } from '@dcl/schemas'
import { stringToUtf8Bytes } from 'eth-connect'

Expand Down
4 changes: 2 additions & 2 deletions src/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ export async function initComponents(): Promise<AppComponents> {
const fs = createFsComponent()

const storage = bucket
? await createAwsS3BasedFileSystemContentStorage({ fs, config }, bucket)
: await createFolderBasedFileSystemContentStorage({ fs }, storageFolder)
? await createAwsS3BasedFileSystemContentStorage({ config, logs }, bucket)
: await createFolderBasedFileSystemContentStorage({ fs, logs }, storageFolder)

const subGraphUrl = await config.requireString('MARKETPLACE_SUBGRAPH_URL')
const marketplaceSubGraph = await createSubgraphComponent({ config, logs, metrics, fetch }, subGraphUrl)
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/handlers/deploy-entity-handler.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Entity } from '@dcl/schemas'
import { IHttpServerComponent } from '@well-known-components/interfaces'
import { FormDataContext } from '../../logic/multipart'
import { extractAuthChain } from '../../logic/extract-auth-chain'
import { HandlerContextWithPath, InvalidRequestError } from '../../types'
import { extractAuthChain } from '../../logic/extract-auth-chain'

export function requireString(val: string | null | undefined): string {
if (typeof val !== 'string') throw new Error('A string was expected')
Expand Down
2 changes: 1 addition & 1 deletion test/integration/acl-handlers.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test } from '../components'
import { getIdentity, storeJson } from '../utils'
import { Authenticator } from '@dcl/crypto'
import { streamToBuffer } from '@dcl/catalyst-storage/dist/content-item'
import { streamToBuffer } from '@dcl/catalyst-storage'

test('acl handler GET /acl/:world_name', function ({ components }) {
it('returns an error when world does not exist', async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/deploy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Sinon from 'sinon'
import { stringToUtf8Bytes } from 'eth-connect'
import { hashV1 } from '@dcl/hashing'
import { getIdentity, storeJson } from '../utils'
import { streamToBuffer } from '@dcl/catalyst-storage/dist/content-item'
import { streamToBuffer } from '@dcl/catalyst-storage'

test('deployment works', function ({ components, stubComponents }) {
it('creates an entity and deploys it', async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/index-handler.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test } from '../components'
import { bufferToStream } from '@dcl/catalyst-storage/dist/content-item'
import { bufferToStream } from '@dcl/catalyst-storage'
import { stringToUtf8Bytes } from 'eth-connect'
import { WorldData } from '../../src/types'

Expand Down
2 changes: 1 addition & 1 deletion test/unit/validations/scene.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { createMockNamePermissionChecker } from '../../mocks/dcl-name-checker-mo
import { getIdentity, Identity } from '../../utils'
import { IConfigComponent } from '@well-known-components/interfaces'
import { hashV1 } from '@dcl/hashing'
import { bufferToStream } from '@dcl/catalyst-storage/dist/content-item'
import { bufferToStream } from '@dcl/catalyst-storage'
import { createWorldsManagerComponent } from '../../../src/adapters/worlds-manager'
import { createLogComponent } from '@well-known-components/logger'
import {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/world-indexer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { IConfigComponent, ILoggerComponent } from '@well-known-components/inter
import { createConfigComponent } from '@well-known-components/env-config-provider'
import { createInMemoryStorage, IContentStorageComponent } from '@dcl/catalyst-storage'
import { createWorldsManagerComponent } from '../../src/adapters/worlds-manager'
import { bufferToStream, streamToBuffer } from '@dcl/catalyst-storage/dist/content-item'
import { bufferToStream, streamToBuffer } from '@dcl/catalyst-storage'
import { stringToUtf8Bytes } from 'eth-connect'
import { IWorldsIndexer, IWorldsManager, WorldData } from '../../src/types'

Expand Down
Loading

0 comments on commit ee9b601

Please sign in to comment.