Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
samteb committed Feb 27, 2024
1 parent c80de6c commit 3ed47be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable @typescript-eslint/no-explicit-any
import { Action, Request, UserRole } from '@narval/policy-engine-shared'
import { InputType, safeDecode } from '@narval/transaction-request-intent'
import { loadPolicy } from '@open-policy-agent/opa-wasm'
Expand All @@ -9,10 +10,9 @@ import wallets from './data/wallets.json'
import legacyRequests from './requests/legacy-requests.json'

export const run = async () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const entities: { [key: string]: any } = { users: {}, wallets: {} }

Check failure on line 13 in apps/policy-engine/src/opa/script/evaluate-legacy-policy.script.ts

View workflow job for this annotation

GitHub Actions / Build and test

Unexpected any. Specify a different type

for (const user of users) {
for (const user of users as any[]) {

Check failure on line 15 in apps/policy-engine/src/opa/script/evaluate-legacy-policy.script.ts

View workflow job for this annotation

GitHub Actions / Build and test

Unexpected any. Specify a different type
let role = user.guildUserRole
if (['SCHOLAR'].includes(role)) {
role = UserRole.MEMBER
Expand All @@ -22,13 +22,13 @@ export const run = async () => {
entities.users[user.id] = { uid: user.id, role }
}

for (const wallet of wallets) {
for (const wallet of wallets as any[]) {

Check failure on line 25 in apps/policy-engine/src/opa/script/evaluate-legacy-policy.script.ts

View workflow job for this annotation

GitHub Actions / Build and test

Unexpected any. Specify a different type
const uid = `eip155:${wallet.accountType}:${wallet.address}`
entities.wallets[uid] = {
uid,
address: wallet.address,
accountType: wallet.accountType,
assignees: wallet.assignees?.map((assignee) => assignee.userId) || []
assignees: wallet.assignees?.map((assignee: any) => assignee.userId) || []

Check failure on line 31 in apps/policy-engine/src/opa/script/evaluate-legacy-policy.script.ts

View workflow job for this annotation

GitHub Actions / Build and test

Unexpected any. Specify a different type
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable @typescript-eslint/no-explicit-any
import { EntityType, FiatCurrency, UserRole, ValueOperators } from '@narval/policy-engine-shared'
import axios from 'axios'
import { omit } from 'lodash'
Expand Down Expand Up @@ -322,7 +323,7 @@ export const translateLegacyPolicy = (oldPolicy: OldPolicy): NewPolicy | null =>
}

export const run = () => {
const data = policies
const data = (policies as any[])

Check failure on line 326 in apps/policy-engine/src/opa/script/translate-legacy-policy.script.ts

View workflow job for this annotation

GitHub Actions / Build and test

Unexpected any. Specify a different type
.map((policy) => {
const copy = omit(policy, ['guild_id', 'sequence', 'version', 'amount']) as OldPolicy
copy.amount = policy.amount ? `${policy.amount}` : null
Expand Down

0 comments on commit 3ed47be

Please sign in to comment.