Skip to content

Commit

Permalink
refactor(sdk): tweak sdk to use vitest native env helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
Quazia committed Sep 18, 2024
1 parent 7b3cf4d commit e5d3764
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/sdk/hardhat.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
forking: {
url:
'https://base-mainnet.g.alchemy.com/v2/' +
process.env.ALCHEMY_API_KEY,
process.env.VITE_ALCHEMY_API_KEY,
},
},
},
Expand Down
14 changes: 5 additions & 9 deletions packages/sdk/test/zora-fork-mint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
mine,
reset,
} from '@nomicfoundation/hardhat-toolbox-viem/network-helpers';
import dotenv from 'dotenv';
import {
http,
type Address,
Expand Down Expand Up @@ -35,21 +34,19 @@ import {
fundBudget,
} from './helpers';

dotenv.config();

let fixtures: Fixtures, budgets: BudgetFixtures;

describe('Boost with NFT Minting Incentive', () => {
if (!process.env.ALCHEMY_API_KEY) {
console.warn('Skipping tests: ALCHEMY_API_KEY is not defined');
test.skip('Skipping tests: ALCHEMY_API_KEY is not defined');
if (process.env.VITE_ALCHEMY_API_KEY) {
console.warn('Skipping tests: VITE_ALCHEMY_API_KEY is not defined');
test.skip('Skipping tests: VITE_ALCHEMY_API_KEY is not defined');
return;
}
// We take the address of the imposter from the transaction above
const boostImpostor = '0x84DC02a3B41ff6Fb0B9288234B2B8051B641bF00' as Address;
const trustedSigner = accounts.at(0)!;
const BASE_CHAIN_URL =
'https://base-mainnet.g.alchemy.com/v2/' + process.env.ALCHEMY_API_KEY;
'https://base-mainnet.g.alchemy.com/v2/' + process.env.VITE_ALCHEMY_API_KEY;
const BASE_CHAIN_BLOCK = 17519193;
const selector = selectors[
'Purchased(address,address,uint256,uint256,uint256)'
Expand Down Expand Up @@ -180,8 +177,7 @@ describe('Boost with NFT Minting Incentive', () => {
expect(testReceipt).toBeDefined();
const validation = await action.validateActionSteps();
expect(validation).toBe(true);

// Geenrate the signature using the trusted signer
// Generate the signature using the trusted signer
const claimDataPayload = await prepareSignerValidatorClaimDataPayload({
signer: trustedSigner,
incentiveData,
Expand Down
2 changes: 2 additions & 0 deletions packages/sdk/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { loadEnv } from 'vite';
import { defineConfig } from 'vitest/config';

export default defineConfig({
define: {},
test: {
fileParallelism: false,
env: loadEnv('', process.cwd(), ''),
globalSetup: ['./test/setup.hardhat.ts'],
// reporters: [
// 'default',
Expand Down

0 comments on commit e5d3764

Please sign in to comment.