From 11bd82c3c856435321e6718760240f4c61c9a7cf Mon Sep 17 00:00:00 2001 From: Sam McCord Date: Wed, 26 Jun 2024 13:30:39 -0600 Subject: [PATCH] chore: get contract deployments working --- packages/sdk/test/helpers.ts | 5 +++-- packages/sdk/test/setup.hardhat.ts | 2 +- packages/sdk/test/viem.ts | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/sdk/test/helpers.ts b/packages/sdk/test/helpers.ts index 570216f7..40c9b296 100644 --- a/packages/sdk/test/helpers.ts +++ b/packages/sdk/test/helpers.ts @@ -16,7 +16,7 @@ import PointsIncentive from '@boostxyz/evm/artifacts/contracts/incentives/Points import SignerValidator from '@boostxyz/evm/artifacts/contracts/validators/SignerValidator.sol/SignerValidator.json'; import type { Address, Hex } from 'viem'; import { accounts } from './accounts'; -import { mockWalletClient, setupConfig } from './viem'; +import { mockWalletClient, setupConfig, testAccount } from './viem'; export interface Fixtures { bases: { type: RegistryType; name: string; base: Address }[]; @@ -166,7 +166,8 @@ export async function deployFixtures( for (const { type, name, base } of bases) { await writeBoostRegistryRegister(config, { - address: account, + account: { ...testAccount, type: 'local' }, + address: registry, args: [type, name, base], }); } diff --git a/packages/sdk/test/setup.hardhat.ts b/packages/sdk/test/setup.hardhat.ts index 5ded84d8..84e1532c 100644 --- a/packages/sdk/test/setup.hardhat.ts +++ b/packages/sdk/test/setup.hardhat.ts @@ -50,7 +50,7 @@ export async function setup({ provide }: GlobalSetupContext) { } provide('wsPort', 3000); - return async function () { + return function () { if (process && !process.killed) { process.kill(); } diff --git a/packages/sdk/test/viem.ts b/packages/sdk/test/viem.ts index c1780d53..2b6ebc61 100644 --- a/packages/sdk/test/viem.ts +++ b/packages/sdk/test/viem.ts @@ -1,10 +1,12 @@ -import { mock } from '@wagmi/connectors'; import { createConfig } from '@wagmi/core'; import { http, createTestClient, publicActions, walletActions } from 'viem'; import { hardhat } from 'viem/chains'; + +import { privateKeyToAccount } from 'viem/accounts'; import { accounts } from './accounts'; const { account, key } = accounts.at(0)!; +export const testAccount = privateKeyToAccount(key); export const mockWalletClient = createTestClient({ transport: http(), @@ -12,7 +14,6 @@ export const mockWalletClient = createTestClient({ mode: 'hardhat', account, key, - // pollingInterval: 250, }) .extend(publicActions) .extend(walletActions); @@ -20,7 +21,6 @@ export const mockWalletClient = createTestClient({ export function setupConfig(walletClient = mockWalletClient) { return createConfig({ chains: [hardhat], - connectors: [mock({ accounts: [account] })], client: () => walletClient, }); }