Skip to content

Commit

Permalink
fix: erc20 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvkelawala committed Oct 13, 2022
1 parent 8304fdf commit 2b6aa24
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions __tests__/defaultProvider.test.ts
@@ -1,13 +1,6 @@
import {
BlockNumber,
DeclareContractResponse,
DeployContractResponse,
GetBlockResponse,
stark,
} from '../src';
import { BlockNumber, DeployContractResponse, GetBlockResponse, stark } from '../src';
import { toBN } from '../src/utils/number';
import {
compiledErc20,
compiledOpenZeppelinAccount,
describeIfNotDevnet,
getERC20DeployPayload,
Expand Down Expand Up @@ -249,16 +242,13 @@ describe('defaultProvider', () => {
describe('Contract methods', () => {
let contractAddress: string;
let deployResponse: DeployContractResponse;
let declareResponse: DeclareContractResponse;
let blockNumber: BlockNumber;

beforeAll(async () => {
deployResponse = await provider.deployContract({ contract: compiledErc20 });
const erc20DeployPayload = getERC20DeployPayload(wallet);
deployResponse = await provider.deployContract(erc20DeployPayload);
contractAddress = deployResponse.contract_address;
await Promise.all([
provider.waitForTransaction(deployResponse.transaction_hash),
provider.waitForTransaction(declareResponse.transaction_hash),
]);
await provider.waitForTransaction(deployResponse.transaction_hash);
({ block_number: blockNumber } = await provider.getBlock('latest'));
});

Expand All @@ -284,9 +274,9 @@ describe('defaultProvider', () => {
provider
.callContract({
contractAddress: deployResponse.contract_address,
entrypoint: 'balance_of',
entrypoint: 'balanceOf',
calldata: compileCalldata({
user: '0x9ff64f4ab0e1fe88df4465ade98d1ea99d5732761c39279b8e1374fa943e9b',
user: wallet,
}),
})
.then((res) => {
Expand Down

0 comments on commit 2b6aa24

Please sign in to comment.