"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
const initTestEnvironment_1 = require("../../../../tests/utils/initTestEnvironment");
const getToken_1 = require("../calls/getToken");
const token_math_1 = require("@melonproject/token-math");
const balanceOf_1 = require("../calls/balanceOf");
const deployWeth_1 = require("./deployWeth");
const deposit_1 = require("./deposit");
describe('deposit', () => {
    const shared = {};
    beforeAll(() => __awaiter(this, void 0, void 0, function* () {
        shared.env = yield initTestEnvironment_1.initTestEnvironment();
        shared.weth = yield getToken_1.getToken(shared.env, yield deployWeth_1.deployWeth(shared.env));
    }));
    it('deposit', () => __awaiter(this, void 0, void 0, function* () {
        const quantity = token_math_1.createQuantity(shared.weth, 1);
        yield deposit_1.deposit(shared.env, quantity.token.address, undefined, {
            value: quantity.quantity.toString(),
        });
        const balance = yield balanceOf_1.balanceOf(shared.env, shared.weth.address);
        expect(token_math_1.isEqual(quantity, balance)).toBe(true);
    }));
});
