Skip to content

Commit

Permalink
format & lint
Browse files Browse the repository at this point in the history
  • Loading branch information
mattschoch committed Jan 18, 2024
1 parent 5955e88 commit 7d64bec
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
6 changes: 3 additions & 3 deletions apps/authz/src/app/app.controller.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { EvaluationRequestDto } from '@app/authz/app/evaluation-request.dto'
import { generateInboundRequest } from '@app/authz/shared/module/persistence/mock_data'
import { AuthZRequestPayload } from '@app/authz/shared/types/http'
import { Body, Controller, Get, Logger, Post } from '@nestjs/common'
import { AppService } from './app.service'
import { EvaluationRequestDto } from '@app/authz/app/evaluation-request.dto'
import { AuthZRequestPayload } from '@app/authz/shared/types/http'

@Controller()
export class AppController {
Expand Down Expand Up @@ -31,7 +31,7 @@ export class AppController {
})

// Map the DTO into the TS type because it's nicer to deal with.
const payload: AuthZRequestPayload = body;
const payload: AuthZRequestPayload = body

const result = await this.appService.runEvaluation(payload)
this.logger.log({
Expand Down
10 changes: 6 additions & 4 deletions apps/authz/src/app/app.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import {
import { OpaResult, RegoInput } from '@app/authz/shared/types/rego'
import { safeDecode } from '@narval/transaction-request-intent'
import { Injectable } from '@nestjs/common'
import { InputType } from 'packages/transaction-request-intent/src/lib/domain'
import { Intent } from 'packages/transaction-request-intent/src/lib/intent.types'
import { Hex, verifyMessage } from 'viem'
import { privateKeyToAccount } from 'viem/accounts'
import { OpaService } from './opa/opa.service'
import { InputType } from 'packages/transaction-request-intent/src/lib/domain'

const ENGINE_PRIVATE_KEY = '0x7cfef3303797cbc7515d9ce22ffe849c701b0f2812f999b0847229c47951fca5'

Expand Down Expand Up @@ -76,9 +76,11 @@ export class AppService {
principal: {
uid: principal.userId
},
resource: request.resourceId ? {
uid: request.resourceId
} : undefined,
resource: request.resourceId
? {
uid: request.resourceId
}
: undefined,
approvals: approvals || []
}
}
Expand Down
4 changes: 2 additions & 2 deletions apps/authz/src/app/evaluation-request.dto.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Action, Alg } from '@app/authz/shared/types/enums'
import { Address, Hex, FiatSymbols } from '@app/authz/shared/types/http'
import { Address, FiatSymbols, Hex } from '@app/authz/shared/types/http'
import { ApiExtraModels, ApiProperty, getSchemaPath } from '@nestjs/swagger'
import { Transform, Type } from 'class-transformer'
import { IsDefined, IsEnum, IsEthereumAddress, IsString, ValidateNested } from 'class-validator'
Expand Down Expand Up @@ -65,7 +65,7 @@ export class TransactionRequestDto {

accessList?: { address: Address; storageKeys: Hex[] }[]

type?: "2"
type?: '2'
}

export class SignTransactionRequestDataDto extends BaseRequestDataDto {
Expand Down
4 changes: 2 additions & 2 deletions apps/authz/src/shared/module/persistence/mock_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
Wallet,
WalletGroup
} from '@app/authz/shared/types/entities.types'
import { AccountType, Alg, Action, UserRoles } from '@app/authz/shared/types/enums'
import { AccountType, Action, Alg, UserRoles } from '@app/authz/shared/types/enums'
import { AuthCredential, AuthZRequestPayload, TransactionRequest } from '@app/authz/shared/types/http'
import { RegoInput } from '@app/authz/shared/types/rego'
import { Caip10, Caip19 } from 'packages/transaction-request-intent/src/lib/caip'
Expand Down Expand Up @@ -377,4 +377,4 @@ export const generateInboundRequest = async (): Promise<AuthZRequestPayload> =>
}
}
*/
*/
1 change: 0 additions & 1 deletion apps/authz/src/shared/types/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export type HistoricalTransfer = {
timestamp: number // unix timestamp
}


// Types ripped from viem; combining a few though because they don't have chainId on txRequest
export type Hex = `0x${string}`
export type Address = `0x${string}`
Expand Down

0 comments on commit 7d64bec

Please sign in to comment.