"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PopulateEffectsForAddressTransform = exports.PopulateEffectsTransform = void 0;
const streamWithEventPipe_1 = require("../../../../utils/streamWithEventPipe");
class PopulateEffectsTransform extends streamWithEventPipe_1.TransformWithEventPipe {
    constructor(evm) {
        super({ objectMode: true });
        this.evm = evm;
    }
    async _transform(tx, _, done) {
        // Add effects to old db entries
        tx = this.evm.populateEffects(tx);
        this.push(tx);
        return done();
    }
}
exports.PopulateEffectsTransform = PopulateEffectsTransform;
class PopulateEffectsForAddressTransform extends streamWithEventPipe_1.TransformWithEventPipe {
    constructor(evm, addresses) {
        super({ objectMode: true });
        this.evm = evm;
        this.addresses = addresses;
    }
    async _transform(tx, _, done) {
        tx = this.evm.populateEffectsForAddresses(tx, this.addresses);
        this.push(tx);
        return done();
    }
}
exports.PopulateEffectsForAddressTransform = PopulateEffectsForAddressTransform;
//# sourceMappingURL=populateEffectsTransform.js.map