Skip to content

Commit

Permalink
chore: move tests to contract folder (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
luizstacio committed Mar 15, 2022
1 parent 1291c8a commit be2ce59
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import { seedWallet } from '@fuel-ts/wallet/dist/test-utils';
import { readFileSync } from 'fs';
import { join } from 'path';

import abiJSON from './call-test-contract/out/debug/call-test-abi.json';
import ContractFactory from './contract-factory';
import ContractFactory from '../contract-factory';

import abiJSON from './out/debug/call-test-abi.json';

const setup = async (abi: ReadonlyArray<JsonFragment> | Interface = abiJSON) => {
const provider = new Provider('http://127.0.0.1:4000/graphql');
Expand All @@ -18,7 +19,7 @@ const setup = async (abi: ReadonlyArray<JsonFragment> | Interface = abiJSON) =>
await seedWallet(wallet, [{ assetId: NativeAssetId, amount: 1 }]);

// Deploy contract
const bytecode = readFileSync(join(__dirname, './call-test-contract/out/debug/call-test.bin'));
const bytecode = readFileSync(join(__dirname, './out/debug/call-test.bin'));
const factory = new ContractFactory(bytecode, abi, wallet);
const contract = await factory.deployContract();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { seedWallet } from '@fuel-ts/wallet/dist/test-utils';
import { readFileSync } from 'fs';
import { join } from 'path';

import ContractFactory from './contract-factory';
import abi from './storage-test-contract/out/debug/storage-test-abi.json';
import ContractFactory from '../contract-factory';

import abi from './out/debug/storage-test-abi.json';

const setup = async () => {
const provider = new Provider('http://127.0.0.1:4000/graphql');
Expand All @@ -16,9 +17,7 @@ const setup = async () => {
await seedWallet(wallet, [{ assetId: NativeAssetId, amount: 1 }]);

// Deploy contract
const bytecode = readFileSync(
join(__dirname, './storage-test-contract/out/debug/storage-test.bin')
);
const bytecode = readFileSync(join(__dirname, './out/debug/storage-test.bin'));
const factory = new ContractFactory(bytecode, abi, wallet);
const contract = await factory.deployContract();

Expand Down

0 comments on commit be2ce59

Please sign in to comment.