"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.queryAllReadonlyContracts = exports.waitForTx = void 0;
const shuffle_1 = __importDefault(require("lodash/shuffle"));
const promises_1 = require("../../utils/promises");
async function waitForTx(txToSubmit) {
    const tx = await txToSubmit;
    return tx.wait();
}
exports.waitForTx = waitForTx;
const queryAllReadonlyContracts = (call, contracts) => {
    return (0, promises_1.tryInSequence)((0, shuffle_1.default)(contracts).map((contract) => {
        return () => call(contract);
    }));
};
exports.queryAllReadonlyContracts = queryAllReadonlyContracts;
//# sourceMappingURL=contract.js.map