"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const contractWrapperBase_1 = require("./contractWrapperBase");
const proposalService_1 = require("./proposalService");
const intVoteInterface_1 = require("./wrappers/intVoteInterface");
class ProposalGeneratorBase extends contractWrapperBase_1.ContractWrapperBase {
    constructor(solidityContract, web3EventService) {
        super(solidityContract, web3EventService);
        this.proposalService = new proposalService_1.ProposalService(web3EventService);
        this.votingMachineFactory = intVoteInterface_1.IntVoteInterfaceFactory;
    }
    /**
     * Return the address of the voting machine for this scheme as registered with the given avatar.
     * @param avatarAddress
     */
    getVotingMachineAddress(avatarAddress) {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            return (yield this._getSchemeParameters(avatarAddress)).votingMachineAddress;
        });
    }
    /**
     * Return IntVoteInterfaceWrapper for this scheme as registered with the given avatar.
     * @param avatarAddress
     */
    getVotingMachine(avatarAddress) {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            const votingMachineAddress = yield this.getVotingMachineAddress(avatarAddress);
            return this.votingMachineFactory.at(votingMachineAddress);
        });
    }
}
exports.ProposalGeneratorBase = ProposalGeneratorBase;
//# sourceMappingURL=proposalGeneratorBase.js.map