"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const chai_1 = require("chai");
const src_1 = require("../../../src");
const testUtils_1 = require("../../testUtils");
const XRPMccConnection = {
    url: process.env.XRP_URL || "https://xrplcluster.com",
    username: process.env.XRP_USERNAME || "",
    password: process.env.XRP_PASSWORD || "",
    apiTokenKey: process.env.FLARE_API_PORTAL_KEY || "",
};
describe(`Account delete type (${(0, testUtils_1.getTestFile)(__filename)})`, function () {
    let MccClient;
    before(async function () {
        src_1.traceManager.displayRuntimeTrace = false;
        src_1.traceManager.displayStateOnException = false;
        MccClient = new src_1.MCC.XRP(XRPMccConnection);
    });
    describe("Account delete happy path", function () {
        let transaction;
        before(async function () {
            transaction = await MccClient.getTransaction("1AF19BF9717DA0B05A3BFC5007873E7743BA54C0311CCCCC60776AAEAC5C4635");
            //  console.dir(transaction.data, { depth: null });
        });
        it("should correctly parse sourceAddresses", async function () {
            (0, chai_1.expect)(transaction.sourceAddresses).to.deep.equal(["rf2c74F1Z2BrvL1dV7WMHYo6Jyaw446Fre"]);
        });
        it("should correctly parse receivingAddresses", async function () {
            (0, chai_1.expect)(transaction.receivingAddresses).to.deep.equal(["rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"]);
        });
        it("should correctly parse spentAmounts", async function () {
            const expected = [{ address: "rf2c74F1Z2BrvL1dV7WMHYo6Jyaw446Fre", amount: (0, src_1.toBN)("2000000").add((0, src_1.toBN)("12665795")) }];
            (0, chai_1.expect)((0, testUtils_1.AddressAmountEqual)(transaction.spentAmounts, expected)).to.be.true;
        });
        it("should correctly parse receivedAmounts", async function () {
            const expected = [{ address: "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", amount: (0, src_1.toBN)("12665795") }];
            (0, chai_1.expect)((0, testUtils_1.AddressAmountEqual)(transaction.receivedAmounts, expected)).to.be.true;
        });
        it("should get balanceDecreasingSummary", async function () {
            const summary = await transaction.balanceDecreasingSummary({ sourceAddressIndicator: (0, src_1.standardAddressHash)("rf2c74F1Z2BrvL1dV7WMHYo6Jyaw446Fre") });
            (0, chai_1.expect)(summary.status).to.eq(src_1.BalanceDecreasingSummaryStatus.Success);
            (0, chai_1.expect)(summary.response.spentAmount.toString()).to.eq((0, src_1.toBN)("2000000").add((0, src_1.toBN)("12665795")).toString());
        });
    });
});
//# sourceMappingURL=accountDelete.test.js.map