Skip to content

Commit

Permalink
Merge branch 'master' of github.com:decentraland/builder-server into …
Browse files Browse the repository at this point in the history
…fix/tp-manager-check
  • Loading branch information
LautaroPetaccio committed Mar 9, 2022
2 parents dada75f + 7917e5b commit 31eec2b
Show file tree
Hide file tree
Showing 28 changed files with 1,224 additions and 447 deletions.
26 changes: 26 additions & 0 deletions migrations/1646234502768_add-cheque-signature-column.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate'
import { SlotUsageCheque } from '../src/SlotUsageCheque'

const tableName = SlotUsageCheque.tableName
const oldColumnName = 'signedMessage'

const columns = {
signature: { type: 'TEXT', notNull: true },
salt: { type: 'VARCHAR(66)', notNull: true },
qty: { type: 'INT', notNull: true },
}

export const shorthands: ColumnDefinitions | undefined = undefined

export async function up(pgm: MigrationBuilder): Promise<void> {
pgm.dropColumn(tableName, oldColumnName)
pgm.addColumn(tableName, columns)
}

export async function down(pgm: MigrationBuilder): Promise<void> {
pgm.dropColumn(tableName, columns)
pgm.addColumn(tableName, {
[oldColumnName]: { type: 'TEXT', notNull: true },
})
}
65 changes: 23 additions & 42 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions spec/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ export function mockAuthorizationMiddleware(

/**
* Mocks the "withModelAuthorization" middleware used in the collection's middleware
* by mocking all the function calls to the Collection model and the TPW requests.
* This mock requires the Collection model and the TPW API "isManager" method to be mocked first.
* by mocking all the function calls to the Collection model and the TP requests.
* This mock requires the Collection model and the TP API "isManager" method to be mocked first.
*
* @param id - The id of the collection to be authorized.
* @param ethAddress - The ethAddress of the user that will be requesting authorization to the collection.
Expand Down Expand Up @@ -218,7 +218,7 @@ export function mockThirdPartyURNExists(

/**
* Mocks the "withModelAuthorization" middleware used in the items's middleware
* by mocking all the function calls to the Collection model and the TPW requests.
* by mocking all the function calls to the Collection model and the TP requests.
* This mock requires the Item model findOne method to be mocked first.
*
* @param id - The id of the item to be authorized.
Expand Down
Loading

0 comments on commit 31eec2b

Please sign in to comment.