"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.mineRandomBlocks = mineRandomBlocks;
var tslib_1 = require("tslib");
var hardhat_1 = tslib_1.__importDefault(require("hardhat"));
function mineRandomBlocks(amount) {
    return tslib_1.__awaiter(this, void 0, void 0, function () {
        var randomBlocksToMine, i;
        return tslib_1.__generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    randomBlocksToMine = amount !== null && amount !== void 0 ? amount : Math.ceil(Math.random() * 10);
                    i = 0;
                    _a.label = 1;
                case 1:
                    if (!(i < randomBlocksToMine)) return [3, 4];
                    return [4, hardhat_1.default.network.provider.send("evm_mine")];
                case 2:
                    _a.sent();
                    _a.label = 3;
                case 3:
                    i++;
                    return [3, 1];
                case 4: return [2];
            }
        });
    });
}
//# sourceMappingURL=BlockchainUtils.js.map