Skip to content

Commit

Permalink
chore: get contract deployments working
Browse files Browse the repository at this point in the history
  • Loading branch information
sammccord committed Jun 26, 2024
1 parent 8d74f2b commit 11bd82c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions packages/sdk/test/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }[];
Expand Down Expand Up @@ -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],
});
}
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/test/setup.hardhat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export async function setup({ provide }: GlobalSetupContext) {
}
provide('wsPort', 3000);

return async function () {
return function () {
if (process && !process.killed) {
process.kill();
}
Expand Down
6 changes: 3 additions & 3 deletions packages/sdk/test/viem.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
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(),
chain: hardhat,
mode: 'hardhat',
account,
key,
// pollingInterval: 250,
})
.extend(publicActions)
.extend(walletActions);

export function setupConfig(walletClient = mockWalletClient) {
return createConfig({
chains: [hardhat],
connectors: [mock({ accounts: [account] })],
client: () => walletClient,
});
}

0 comments on commit 11bd82c

Please sign in to comment.