@vechain/vebetterdao-contracts
Version:
Open-source repository that houses the smart contracts powering the decentralized VeBetterDAO on the VeChain Thor blockchain.
42 lines (41 loc) • 2.93 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)("Governance - V10 Upgrade - @shard4g", function () {
(0, mocha_1.it)("Should deploy through full upgrade chain and report version 10", async () => {
const config = (0, local_1.createLocalConfig)();
const { governor } = await (0, helpers_1.getOrDeployContractInstances)({ forceDeploy: true, config });
(0, chai_1.expect)(await governor.version()).to.equal("10");
(0, chai_1.expect)(await governor.getAddress()).to.not.equal(hardhat_1.ethers.ZeroAddress);
});
(0, mocha_1.it)("Should preserve external contract references after upgrade chain", async () => {
const config = (0, local_1.createLocalConfig)();
const { governor, vot3, b3tr, voterRewards, xAllocationVoting, relayerRewardsPool, navigatorRegistry } = await (0, helpers_1.getOrDeployContractInstances)({
forceDeploy: true,
config,
});
(0, chai_1.expect)(await governor.token()).to.equal(await vot3.getAddress());
(0, chai_1.expect)(await governor.b3tr()).to.equal(await b3tr.getAddress());
(0, chai_1.expect)(await governor.voterRewards()).to.equal(await voterRewards.getAddress());
(0, chai_1.expect)(await governor.xAllocationVoting()).to.equal(await xAllocationVoting.getAddress());
(0, chai_1.expect)(await governor.navigatorRegistry()).to.equal(await navigatorRegistry.getAddress());
(0, chai_1.expect)(await governor.relayerRewardsPool()).to.equal(await relayerRewardsPool.getAddress());
});
(0, mocha_1.it)("Should preserve roles after upgrade chain", async () => {
const config = (0, local_1.createLocalConfig)();
const { governor, owner } = await (0, helpers_1.getOrDeployContractInstances)({ forceDeploy: true, config });
(0, chai_1.expect)(await governor.hasRole(await governor.DEFAULT_ADMIN_ROLE(), owner.address)).to.be.true;
(0, chai_1.expect)(await governor.hasRole(await governor.GOVERNOR_FUNCTIONS_SETTINGS_ROLE(), owner.address)).to.be.true;
(0, chai_1.expect)(await governor.hasRole(await governor.PAUSER_ROLE(), owner.address)).to.be.true;
(0, chai_1.expect)(await governor.hasRole(await governor.PROPOSAL_STATE_MANAGER_ROLE(), owner.address)).to.be.true;
});
(0, mocha_1.it)("Should preserve governance settings after upgrade chain", async () => {
const config = (0, local_1.createLocalConfig)();
const { governor } = await (0, helpers_1.getOrDeployContractInstances)({ forceDeploy: true, config });
(0, chai_1.expect)(await governor.minVotingDelay()).to.equal(config.B3TR_GOVERNOR_MIN_VOTING_DELAY);
});
});