Skip to content

Commit

Permalink
Narrow post delegates types (#1279)
Browse files Browse the repository at this point in the history
Narrow some `TransactionApi.postDelegate` input types form plain `string` to `0x${string}`.
  • Loading branch information
hectorgomezv authored Mar 12, 2024
1 parent c32081a commit 5233abd
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/datasources/transaction-api/transaction-api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ export class TransactionApi implements ITransactionApi {
}

async postDelegate(args: {
safeAddress: string | null;
delegate: string;
delegator: string;
safeAddress: `0x${string}` | null;
delegate: `0x${string}`;
delegator: `0x${string}`;
signature: string;
label: string;
}): Promise<void> {
Expand Down
6 changes: 3 additions & 3 deletions src/domain/delegate/delegate.repository.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export interface IDelegateRepository {

postDelegate(args: {
chainId: string;
safeAddress: string | null;
delegate: string;
delegator: string;
safeAddress: `0x${string}` | null;
delegate: `0x${string}`;
delegator: `0x${string}`;
signature: string;
label: string;
}): Promise<void>;
Expand Down
6 changes: 3 additions & 3 deletions src/domain/delegate/delegate.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ export class DelegateRepository implements IDelegateRepository {

async postDelegate(args: {
chainId: string;
safeAddress: string | null;
delegate: string;
delegator: string;
safeAddress: `0x${string}` | null;
delegate: `0x${string}`;
delegator: `0x${string}`;
signature: string;
label: string;
}): Promise<void> {
Expand Down
6 changes: 3 additions & 3 deletions src/domain/interfaces/transaction-api.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ export interface ITransactionApi {
}): Promise<Page<Delegate>>;

postDelegate(args: {
safeAddress: string | null;
delegate: string;
delegator: string;
safeAddress: `0x${string}` | null;
delegate: `0x${string}`;
delegator: `0x${string}`;
signature: string;
label: string;
}): Promise<void>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { z } from 'zod';
import { AddressSchema } from '@/validation/entities/schemas/address.schema';

export const CreateDelegateDtoSchema = z.object({
safe: AddressSchema.optional().nullable().default(null),
safe: AddressSchema.nullish().default(null),
delegate: AddressSchema,
delegator: AddressSchema,
signature: z.string(),
Expand Down

0 comments on commit 5233abd

Please sign in to comment.