Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
janek26 committed Jun 14, 2022
1 parent 8972e0b commit 593dfa1
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions __tests__/contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ import {
getTestProvider,
} from './fixtures';

const provider = getTestProvider();

describe('class Contract {}', () => {
const wallet = stark.randomAddress();
const provider = getTestProvider();

describe('Basic Interaction', () => {
let erc20: Contract;
Expand All @@ -24,7 +25,7 @@ describe('class Contract {}', () => {
const { code, transaction_hash, address } = await provider.deployContract({
contract: compiledErc20,
});
erc20 = new Contract(compiledErc20.abi, address, provider);
erc20 = new Contract(compiledErc20.abi, address!, provider);
expect(code).toBe('TRANSACTION_RECEIVED');
await provider.waitForTransaction(transaction_hash);
// Deploy Multicall
Expand All @@ -37,7 +38,7 @@ describe('class Contract {}', () => {
contract: compiledMulticall,
});

contract = new Contract(compiledMulticall.abi, multicallAddress);
contract = new Contract(compiledMulticall.abi, multicallAddress!);

expect(m_code).toBe('TRANSACTION_RECEIVED');

Expand Down Expand Up @@ -94,7 +95,7 @@ describe('class Contract {}', () => {
const { code, transaction_hash, address } = await provider.deployContract({
contract: compiledTypeTransformation,
});
contract = new Contract(compiledTypeTransformation.abi, address, provider);
contract = new Contract(compiledTypeTransformation.abi, address!, provider);
expect(code).toBe('TRANSACTION_RECEIVED');
await provider.waitForTransaction(transaction_hash);
});
Expand Down Expand Up @@ -204,7 +205,7 @@ describe('class Contract {}', () => {
const erc20Response = await provider.deployContract({
contract: compiledErc20,
});
erc20Address = erc20Response.address;
erc20Address = erc20Response.address!;
erc20 = new Contract(compiledErc20.abi, erc20Address, provider);
expect(erc20Response.code).toBe('TRANSACTION_RECEIVED');
await provider.waitForTransaction(erc20Response.transaction_hash);
Expand Down Expand Up @@ -239,7 +240,7 @@ describe('class ContractFactory {}', () => {
});
expect(code).toBe('TRANSACTION_RECEIVED');
await provider.waitForTransaction(transaction_hash);
erc20Address = address;
erc20Address = address!;
});
test('deployment of new contract', async () => {
const factory = new ContractFactory(compiledErc20);
Expand Down

0 comments on commit 593dfa1

Please sign in to comment.