"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const units_1 = require("@ethersproject/units");
const hardhat_1 = require("hardhat");
const utils_1 = require("../../utils");
const constants_1 = require("../../constants");
const vector_utils_1 = require("@connext/vector-utils");
describe("StableSwap.sol", function () {
    this.timeout(120000);
    let stableSwap;
    let amount30 = units_1.parseEther("30");
    let amount60 = units_1.parseEther("60");
    let amount90 = units_1.parseEther("90");
    let amount95 = units_1.parseEther("95");
    let amount99 = units_1.parseEther("99");
    let balances = [units_1.parseEther("100"), units_1.parseEther("100"), units_1.parseEther("100")];
    beforeEach(async () => {
        await hardhat_1.deployments.fixture();
        stableSwap = await utils_1.getContract("StableSwap", constants_1.alice);
    });
    describe("getAmplificationParameter", () => {
        it("happy: get amplificationParameter", async () => {
            vector_utils_1.expect(stableSwap.address).to.be.a("string");
            const res = await stableSwap.getAmplificationParameter();
            console.log(res);
        });
    });
    describe("onSwapGivenIn", () => {
        it("happy: run onSwapGivenIn 30", async () => {
            vector_utils_1.expect(stableSwap.address).to.be.a("string");
            const res = await stableSwap.onSwapGivenIn(amount30, balances, 0, 1);
            console.log(res.toString());
            console.log(units_1.formatEther(res));
        });
        it("happy: run onSwapGivenIn 60", async () => {
            vector_utils_1.expect(stableSwap.address).to.be.a("string");
            const res = await stableSwap.onSwapGivenIn(amount60, balances, 0, 1);
            console.log(res.toString());
            console.log(units_1.formatEther(res));
        });
        it("happy: run onSwapGivenIn 90", async () => {
            vector_utils_1.expect(stableSwap.address).to.be.a("string");
            const res = await stableSwap.onSwapGivenIn(amount90, balances, 0, 1);
            console.log(res.toString());
            console.log(units_1.formatEther(res));
        });
        it("happy: run onSwapGivenIn 95", async () => {
            vector_utils_1.expect(stableSwap.address).to.be.a("string");
            const res = await stableSwap.onSwapGivenIn(amount95, balances, 0, 1);
            console.log(res.toString());
            console.log(units_1.formatEther(res));
        });
        it("happy: run onSwapGivenIn 99", async () => {
            vector_utils_1.expect(stableSwap.address).to.be.a("string");
            const res = await stableSwap.onSwapGivenIn(amount99, balances, 0, 1);
            console.log(res.toString());
            console.log(units_1.formatEther(res));
        });
    });
    describe("onSwapGivenOut", () => {
        it("happy: run onSwapGivenOut 30", async () => {
            vector_utils_1.expect(stableSwap.address).to.be.a("string");
            const res = await stableSwap.onSwapGivenOut(amount30, balances, 0, 1);
            console.log(res.toString());
            console.log(units_1.formatEther(res));
        });
        it("happy: run onSwapGivenOut 60", async () => {
            vector_utils_1.expect(stableSwap.address).to.be.a("string");
            const res = await stableSwap.onSwapGivenOut(amount60, balances, 0, 1);
            console.log(res.toString());
            console.log(units_1.formatEther(res));
        });
        it("happy: run onSwapGivenOut 90", async () => {
            vector_utils_1.expect(stableSwap.address).to.be.a("string");
            const res = await stableSwap.onSwapGivenOut(amount90, balances, 0, 1);
            console.log(res.toString());
            console.log(units_1.formatEther(res));
        });
    });
});
//# sourceMappingURL=StableSwap.spec.js.map