"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.setupUmaEcosystem = setupUmaEcosystem;
var tslib_1 = require("tslib");
var getContractFactory_1 = require("../utils/getContractFactory");
var constants_1 = require("../constants");
var utils_1 = require("../../src/utils");
function setupUmaEcosystem(owner) {
    return tslib_1.__awaiter(this, void 0, void 0, function () {
        var timer, finder, identifierWhitelist, mockOracle, optimisticOracle, collateralWhitelist, store;
        return tslib_1.__generator(this, function (_a) {
            switch (_a.label) {
                case 0: return [4, (0, getContractFactory_1.getContractFactory)("Timer", owner)];
                case 1: return [4, (_a.sent()).deploy()];
                case 2:
                    timer = _a.sent();
                    return [4, (0, getContractFactory_1.getContractFactory)("Finder", owner)];
                case 3: return [4, (_a.sent()).deploy()];
                case 4:
                    finder = _a.sent();
                    return [4, (0, getContractFactory_1.getContractFactory)("IdentifierWhitelist", owner)];
                case 5: return [4, (_a.sent()).deploy()];
                case 6:
                    identifierWhitelist = _a.sent();
                    return [4, (0, getContractFactory_1.getContractFactory)("MockOracleAncillary", owner)];
                case 7: return [4, (_a.sent()).deploy(finder.address, timer.address)];
                case 8:
                    mockOracle = _a.sent();
                    return [4, (0, getContractFactory_1.getContractFactory)("SkinnyOptimisticOracle", owner)];
                case 9: return [4, (_a.sent()).deploy(constants_1.refundProposalLiveness, finder.address, timer.address)];
                case 10:
                    optimisticOracle = _a.sent();
                    return [4, (0, getContractFactory_1.getContractFactory)("AddressWhitelist", owner)];
                case 11: return [4, (_a.sent()).deploy()];
                case 12:
                    collateralWhitelist = _a.sent();
                    return [4, (0, getContractFactory_1.getContractFactory)("Store", owner)];
                case 13: return [4, (_a.sent()).deploy({ rawValue: "0" }, { rawValue: "0" }, timer.address)];
                case 14:
                    store = _a.sent();
                    return [4, finder.changeImplementationAddress((0, utils_1.utf8ToHex)("CollateralWhitelist"), collateralWhitelist.address)];
                case 15:
                    _a.sent();
                    return [4, finder.changeImplementationAddress((0, utils_1.utf8ToHex)("IdentifierWhitelist"), identifierWhitelist.address)];
                case 16:
                    _a.sent();
                    return [4, finder.changeImplementationAddress((0, utils_1.utf8ToHex)("SkinnyOptimisticOracle"), optimisticOracle.address)];
                case 17:
                    _a.sent();
                    return [4, finder.changeImplementationAddress((0, utils_1.utf8ToHex)("Store"), store.address)];
                case 18:
                    _a.sent();
                    return [4, finder.changeImplementationAddress((0, utils_1.utf8ToHex)("Oracle"), mockOracle.address)];
                case 19:
                    _a.sent();
                    return [4, identifierWhitelist.addSupportedIdentifier(constants_1.identifier)];
                case 20:
                    _a.sent();
                    return [2, {
                            timer: timer,
                            finder: finder,
                            collateralWhitelist: collateralWhitelist,
                            identifierWhitelist: identifierWhitelist,
                            store: store,
                            optimisticOracle: optimisticOracle,
                            mockOracle: mockOracle,
                        }];
            }
        });
    });
}
//# sourceMappingURL=UmaEcosystemFixture.js.map