Object.defineProperty(exports, "__esModule", { value: true });
const LogServer_1 = require("./LogServer");
class InMemoryLogService extends LogServer_1.LogServer {
    constructor() {
        super(...arguments);
        this._storedLogs = {};
    }
    storeLog(log) {
        this._storedLogs[log.index] = log;
    }
    getLog(index, fn) {
        var log = this._storedLogs[index];
        if (!log) {
            fn(Error("log not found, index is: " + index), null);
            return;
        }
        // deep clone log so we can modify it without affecting the original
        // possibly slow, can fix later
        log = JSON.parse(JSON.stringify(log));
        fn(null, log);
    }
}
exports.default = InMemoryLogService;
//# sourceMappingURL=InMemoryLogService.js.map