Skip to content

Commit 480030c

Browse files
committed
chore: fixing types in tests
1 parent 89fc353 commit 480030c

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

packages/delegation-toolkit/test/caveatUtils.test.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createPublicClient, http, type Hex } from 'viem';
1+
import { type PublicClient, createPublicClient, http, type Hex } from 'viem';
22
import { sepolia } from 'viem/chains';
33
import { beforeEach, describe, expect, it, vi } from 'vitest';
44

@@ -25,7 +25,7 @@ import type { DeleGatorEnvironment } from '../src/types';
2525
const randomBytes32 = (): Hex => randomBytes(32);
2626

2727
describe('Caveat Contract Methods', () => {
28-
let publicClient: ReturnType<typeof createPublicClient>;
28+
let publicClient: PublicClient;
2929
let mockEnvironment: DeleGatorEnvironment;
3030
let caveatClient: CaveatEnforcerClient;
3131

@@ -56,7 +56,7 @@ describe('Caveat Contract Methods', () => {
5656

5757
// Create caveat client for tests
5858
caveatClient = createCaveatEnforcerClient({
59-
client: publicClient as any,
59+
client: publicClient,
6060
environment: mockEnvironment,
6161
});
6262

@@ -474,10 +474,10 @@ describe('Caveat Contract Methods', () => {
474474
const environmentWithoutDelegationManager = {
475475
...mockEnvironment,
476476
DelegationManager: undefined,
477-
} as any;
477+
} as unknown as DeleGatorEnvironment;
478478

479479
const clientWithoutDelegationManager = createCaveatEnforcerClient({
480-
client: publicClient as any,
480+
client: publicClient,
481481
environment: environmentWithoutDelegationManager,
482482
});
483483

@@ -500,10 +500,10 @@ describe('Caveat Contract Methods', () => {
500500
...mockEnvironment.caveatEnforcers,
501501
ERC20PeriodTransferEnforcer: undefined,
502502
},
503-
} as any;
503+
} as unknown as DeleGatorEnvironment;
504504

505505
const clientWithoutEnforcer = createCaveatEnforcerClient({
506-
client: publicClient as any,
506+
client: publicClient,
507507
environment: environmentWithoutEnforcer,
508508
});
509509

@@ -544,7 +544,7 @@ describe('Caveat Contract Methods', () => {
544544
const [clientResult, functionResult] = await Promise.all([
545545
caveatClient.getErc20PeriodTransferEnforcerAvailableAmount(params),
546546
getErc20PeriodTransferEnforcerAvailableAmount(
547-
publicClient as any,
547+
publicClient,
548548
mockEnvironment,
549549
params,
550550
),
@@ -573,7 +573,7 @@ describe('Caveat Contract Methods', () => {
573573
const [clientResult, functionResult] = await Promise.all([
574574
caveatClient.getErc20StreamingEnforcerAvailableAmount(params),
575575
getErc20StreamingEnforcerAvailableAmount(
576-
publicClient as any,
576+
publicClient,
577577
mockEnvironment,
578578
params,
579579
),
@@ -605,7 +605,7 @@ describe('Caveat Contract Methods', () => {
605605
const [clientResult, functionResult] = await Promise.all([
606606
caveatClient.getMultiTokenPeriodEnforcerAvailableAmount(params),
607607
getMultiTokenPeriodEnforcerAvailableAmount(
608-
publicClient as any,
608+
publicClient,
609609
mockEnvironment,
610610
params,
611611
),
@@ -638,7 +638,7 @@ describe('Caveat Contract Methods', () => {
638638
params,
639639
),
640640
getNativeTokenPeriodTransferEnforcerAvailableAmount(
641-
publicClient as any,
641+
publicClient,
642642
mockEnvironment,
643643
params,
644644
),
@@ -667,7 +667,7 @@ describe('Caveat Contract Methods', () => {
667667
const [clientResult, functionResult] = await Promise.all([
668668
caveatClient.getNativeTokenStreamingEnforcerAvailableAmount(params),
669669
getNativeTokenStreamingEnforcerAvailableAmount(
670-
publicClient as any,
670+
publicClient,
671671
mockEnvironment,
672672
params,
673673
),
@@ -702,7 +702,7 @@ describe('Caveat Contract Methods', () => {
702702
const [clientResult, functionResult] = await Promise.all([
703703
caveatClient.getErc20PeriodTransferEnforcerAvailableAmount(params),
704704
getErc20PeriodTransferEnforcerAvailableAmount(
705-
publicClient as any,
705+
publicClient,
706706
mockEnvironment,
707707
params,
708708
),
@@ -742,7 +742,7 @@ describe('Caveat Contract Methods', () => {
742742

743743
await expect(
744744
getErc20PeriodTransferEnforcerAvailableAmount(
745-
publicClient as any,
745+
publicClient,
746746
mockEnvironment,
747747
params,
748748
),

0 commit comments

Comments
 (0)