@vechain/vebetterdao-contracts
Version:
Open-source repository that houses the smart contracts powering the decentralized VeBetterDAO on the VeChain Thor blockchain.
27 lines (26 loc) • 1.76 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const local_1 = require("@repo/config/contracts/envs/local");
const chai_1 = require("chai");
const hardhat_1 = require("hardhat");
const mocha_1 = require("mocha");
const helpers_1 = require("../helpers");
(0, mocha_1.describe)("XAllocationVoting - V10 Upgrade - @shard14a", function () {
(0, mocha_1.it)("Should deploy through full upgrade chain and report version 10", async () => {
const config = (0, local_1.createLocalConfig)();
const { xAllocationVoting } = await (0, helpers_1.getOrDeployContractInstances)({ forceDeploy: true, config });
(0, chai_1.expect)(await xAllocationVoting.version()).to.equal("10");
(0, chai_1.expect)(await xAllocationVoting.getAddress()).to.not.equal(hardhat_1.ethers.ZeroAddress);
});
(0, mocha_1.it)("Should preserve roles after upgrade chain", async () => {
const config = (0, local_1.createLocalConfig)();
const { xAllocationVoting, owner } = await (0, helpers_1.getOrDeployContractInstances)({ forceDeploy: true, config });
(0, chai_1.expect)(await xAllocationVoting.hasRole(await xAllocationVoting.DEFAULT_ADMIN_ROLE(), owner.address)).to.be.true;
(0, chai_1.expect)(await xAllocationVoting.hasRole(await xAllocationVoting.GOVERNANCE_ROLE(), owner.address)).to.be.true;
});
(0, mocha_1.it)("Should preserve voting settings after upgrade chain", async () => {
const config = (0, local_1.createLocalConfig)();
const { xAllocationVoting } = await (0, helpers_1.getOrDeployContractInstances)({ forceDeploy: true, config });
(0, chai_1.expect)(await xAllocationVoting.votingPeriod()).to.equal(config.EMISSIONS_CYCLE_DURATION - 1);
});
});