Skip to content

Commit

Permalink
feat(private-rpc): lint fixes
Browse files Browse the repository at this point in the history
lint fixes.
  • Loading branch information
calvogenerico committed Nov 7, 2024
1 parent 3c9728e commit 31ddea2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 39 deletions.
2 changes: 1 addition & 1 deletion packages/private-rpc/src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ export class ExternalRpcError extends Error {
getErrorData(): unknown {
return this.data;
}
}
}
34 changes: 1 addition & 33 deletions packages/private-rpc/src/permissions/authorizeer.ts
Original file line number Diff line number Diff line change
@@ -1,44 +1,12 @@
import { Address, Hex, toFunctionSelector } from 'viem';
import { Address, Hex } from 'viem';
import {
AccessDeniedRule,
AccessRule,
GroupRule,
Permission,
PublicRule,
} from '@/permissions/access-rules';
import YAML from 'yaml';
import { z } from 'zod';
import { hexSchema } from '@/db/hex-row';
import { Group } from '@/permissions/group';
import { YamlParser } from '@/permissions/yaml-parser';

const yamlParser = z.object({
groups: z.array(
z.object({
name: z.string(),
members: z.array(hexSchema),
}),
),

contracts: z.array(
z.object({
address: hexSchema,
methods: z.array(
z
.object({
selector: z.optional(hexSchema),
signature: z.optional(z.string()),
read: z.union([z.literal('public'), z.array(z.string())]),
write: z.union([z.literal('public'), z.array(z.string())]),
})
.refine(
(obj) => obj.signature !== undefined || obj.selector !== undefined,
),
),
}),
),
});

export class Authorizer {
permissions: Map<string, AccessRule>;

Expand Down
6 changes: 1 addition & 5 deletions packages/private-rpc/src/rpc/rpc-method-handlers.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
JSONLike,
MethodHandler,
RequestContext,
} from '@/rpc/rpc-service';
import { JSONLike, MethodHandler, RequestContext } from '@/rpc/rpc-service';
import {
Hex,
isAddressEqual,
Expand Down

0 comments on commit 31ddea2

Please sign in to comment.