Skip to content

Commit

Permalink
Fixing e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mattschoch committed Mar 14, 2024
1 parent acb11cc commit 294dc75
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Action } from '@narval/policy-engine-shared'
import { Alg } from '@narval/signature'
import { getQueueToken } from '@nestjs/bull'
import { HttpStatus, INestApplication } from '@nestjs/common'
import { ConfigModule } from '@nestjs/config'
Expand All @@ -11,7 +10,6 @@ import { stringToHex } from 'viem'
import { load } from '../../../armory.config'
import { AUTHORIZATION_REQUEST_PROCESSING_QUEUE, REQUEST_HEADER_ORG_ID } from '../../../armory.constant'
import { AuthorizationRequest } from '../../../orchestration/core/type/domain.type'
import { SignatureDto } from '../../../orchestration/http/rest/dto/signature.dto'
import { AuthorizationRequestRepository } from '../../../orchestration/persistence/repository/authorization-request.repository'
import { PersistenceModule } from '../../../shared/module/persistence/persistence.module'
import { TestPrismaService } from '../../../shared/module/persistence/service/test-prisma.service'
Expand All @@ -27,23 +25,12 @@ describe('Authorization Request', () => {
let authzRequestRepository: AuthorizationRequestRepository
let authzRequestProcessingQueue: Queue

const authentication: SignatureDto = {
alg: Alg.ES256K,
pubKey: '0xd75D626a116D4a1959fE3bB938B2e7c116A05890',
sig: '0xe24d097cea880a40f8be2cf42f497b9fbda5f9e4a31b596827e051d78dce75c032fa7e5ee3046f7c6f116e5b98cb8d268fa9b9d222ff44719e2ec2a0d9159d0d1c'
}
const authentication =
'0xe24d097cea880a40f8be2cf42f497b9fbda5f9e4a31b596827e051d78dce75c032fa7e5ee3046f7c6f116e5b98cb8d268fa9b9d222ff44719e2ec2a0d9159d0d1c'

const approvals: SignatureDto[] = [
{
alg: Alg.ES256K,
pubKey: '0x501D5c2Ce1EF208aadf9131a98BAa593258CfA06',
sig: '0x48510e3b74799b8e8f4e01aba0d196e18f66d86a62ae91abf5b89be9391c15661c7d29ee4654a300ed6db977da512475ed5a39f70f677e23d1b2f53c1554d0dd1b'
},
{
alg: Alg.ES256K,
pubKey: '0xab88c8785D0C00082dE75D801Fcb1d5066a6311e',
sig: '0xcc645f43d8df80c4deeb2e60a8c0c15d58586d2c29ea7c85208cea81d1c47cbd787b1c8473dde70c3a7d49f573e491223107933257b2b99ecc4806b7cc16848d1c'
}
const approvals: string[] = [
'0x48510e3b74799b8e8f4e01aba0d196e18f66d86a62ae91abf5b89be9391c15661c7d29ee4654a300ed6db977da512475ed5a39f70f677e23d1b2f53c1554d0dd1b',
'0xcc645f43d8df80c4deeb2e60a8c0c15d58586d2c29ea7c85208cea81d1c47cbd787b1c8473dde70c3a7d49f573e491223107933257b2b99ecc4806b7cc16848d1c'
]

// TODO: Create domain type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export class AuthorizationRequestDto {
authentication: string

@IsDefined()
@IsString()
@ApiProperty({
isArray: true
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
import { ApiProperty } from '@nestjs/swagger'
import { ArrayNotEmpty, IsDefined, ValidateNested } from 'class-validator'
import { SignatureDto } from './signature.dto'
import { ArrayNotEmpty, IsDefined, IsString } from 'class-validator'

export class BaseActionRequestDto {
@IsDefined()
@ApiProperty({
type: () => SignatureDto
})
authentication: SignatureDto
@IsString()
@ApiProperty()
authentication: string

@IsDefined()
@ArrayNotEmpty()
@ValidateNested()
@ApiProperty({
type: () => SignatureDto,
isArray: true
})
approvals: SignatureDto[]
approvals: string[]
}

0 comments on commit 294dc75

Please sign in to comment.