/**
 * A `ValidationStateReader` decorator that records every read before delegating to the wrapped
 * reader. Used by the replay-basis closure tests (and harnesses) to assert that admission
 * performs no validation read outside the reader surface, and to keep recorded read-traces as a
 * regression artifact when validation reads change.
 *
 * Inject via `DwnConfig.instrumentValidationStateReader`.
 */
export class RecordingValidationStateReader {
    inner;
    recordedReads = [];
    constructor(inner) {
        this.inner = inner;
    }
    /** All reads recorded since construction or the last `clearRecordedReads()`. */
    get reads() {
        return [...this.recordedReads];
    }
    /** Clears the recorded reads, e.g. between closure-test scenarios. */
    clearRecordedReads() {
        this.recordedReads.length = 0;
    }
    /** @inheritdoc */
    async fetchInitialRecordsWrite(tenant, recordId) {
        this.recordedReads.push({ method: 'fetchInitialRecordsWrite' });
        return this.inner.fetchInitialRecordsWrite(tenant, recordId);
    }
    /** @inheritdoc */
    async fetchInitialWrite(tenant, recordId) {
        this.recordedReads.push({ method: 'fetchInitialWrite' });
        return this.inner.fetchInitialWrite(tenant, recordId);
    }
    /** @inheritdoc */
    async constructRecordChain(tenant, descendantRecordId) {
        this.recordedReads.push({ method: 'constructRecordChain' });
        return this.inner.constructRecordChain(tenant, descendantRecordId);
    }
    /** @inheritdoc */
    async fetchParentRecord(input) {
        this.recordedReads.push({ method: 'fetchParentRecord' });
        return this.inner.fetchParentRecord(input);
    }
    /** @inheritdoc */
    async hasMatchingRoleRecord(input) {
        this.recordedReads.push({ method: 'hasMatchingRoleRecord' });
        return this.inner.hasMatchingRoleRecord(input);
    }
    /** @inheritdoc */
    async queryLatestRoleRecords(input) {
        this.recordedReads.push({ method: 'queryLatestRoleRecords' });
        return this.inner.queryLatestRoleRecords(input);
    }
    /** @inheritdoc */
    async queryAudienceEpochs(input) {
        this.recordedReads.push({ method: 'queryAudienceEpochs' });
        return this.inner.queryAudienceEpochs(input);
    }
    /** @inheritdoc */
    async fetchGrant(tenant, permissionGrantId) {
        this.recordedReads.push({ method: 'fetchGrant' });
        return this.inner.fetchGrant(tenant, permissionGrantId);
    }
    /** @inheritdoc */
    async fetchOldestGrantRevocation(tenant, permissionGrantId) {
        this.recordedReads.push({ method: 'fetchOldestGrantRevocation' });
        return this.inner.fetchOldestGrantRevocation(tenant, permissionGrantId);
    }
    /** @inheritdoc */
    async fetchNewestRecordsWrite(tenant, recordId) {
        this.recordedReads.push({ method: 'fetchNewestRecordsWrite' });
        return this.inner.fetchNewestRecordsWrite(tenant, recordId);
    }
    /** @inheritdoc */
    async fetchProtocolDefinition(tenant, protocolUri, messageTimestamp) {
        this.recordedReads.push({ method: 'fetchProtocolDefinition' });
        return this.inner.fetchProtocolDefinition(tenant, protocolUri, messageTimestamp);
    }
    /** @inheritdoc */
    async fetchLatestSquashRecordAtScope(input) {
        this.recordedReads.push({ method: 'fetchLatestSquashRecordAtScope' });
        return this.inner.fetchLatestSquashRecordAtScope(input);
    }
    /** @inheritdoc */
    async hasStoredData(tenant, recordId, dataCid) {
        this.recordedReads.push({ method: 'hasStoredData' });
        return this.inner.hasStoredData(tenant, recordId, dataCid);
    }
}
//# sourceMappingURL=recording-validation-state-reader.js.map