Skip to content

Commit

Permalink
refactor(frontend): ic-token.validation -> schema (#3359)
Browse files Browse the repository at this point in the history
# Motivation

As discussed offline in the context of #3357. We actually adopt a new
convention in which Zod schema related are provided in sub-folder
`schema`.

This prevents the introduction of circular dependencies when the
validation uses both types and Zod schema.

# Changes

- Rename `ic-token.validation` to `ic-token.schema`
  • Loading branch information
peterpeterparker authored Nov 5, 2024
1 parent 474ddea commit 1a454ce
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/frontend/src/icp/types/ic-token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
IcInterfaceSchema,
IcTokenSchema,
IcTokenWithoutIdSchema
} from '$icp/validation/ic-token.validation';
} from '$icp/schema/ic-token.schema';
import type { Option } from '$lib/types/utils';
import { z } from 'zod';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import {
IcInterfaceSchema,
IcTokenSchema,
IcTokenWithoutIdSchema
} from '$icp/validation/ic-token.validation';
} from '$icp/schema/ic-token.schema';
import { parseTokenId } from '$lib/validation/token.validation';

describe('Schema Validation Tests', () => {
describe('ic-token.schema', () => {
const { chainId: _, explorerUrl: __, ...mockNetwork } = SEPOLIA_NETWORK;

const mockToken = {
Expand Down

0 comments on commit 1a454ce

Please sign in to comment.