Skip to content

Commit

Permalink
fix tests for upgradeable contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
ququzone committed Jan 31, 2024
1 parent ed1ea84 commit d84723a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions test/VotingEscrow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ describe('VotingEscrow', function () {

before(async function () {
accounts = await ethers.getSigners();
const forwarder = await ethers.deployContract('Forwarder');
const balanceLogic = await ethers.deployContract('BalanceLogicLibrary');
const delegationLogic = await ethers.deployContract('DelegationLogicLibrary');
ve = await ethers.deployContract('VotingEscrow', [forwarder.target, []], {
ve = await ethers.deployContract('VotingEscrow', [], {
signer: accounts[0],
libraries: {
BalanceLogicLibrary: balanceLogic.target,
DelegationLogicLibrary: delegationLogic.target,
},
});
await ve.initialize([]);
});

describe('native bucket', function () {
Expand Down
6 changes: 4 additions & 2 deletions test/flow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ describe('Flow', function () {
const forwarder = await ethers.deployContract('Forwarder');
const b = await ethers.deployContract('BalanceLogicLibrary');
const d = await ethers.deployContract('DelegationLogicLibrary');
const ve = await ethers.deployContract('VotingEscrow', [forwarder.target, []], {
const ve = await ethers.deployContract('VotingEscrow', [], {
libraries: {
BalanceLogicLibrary: b.target,
DelegationLogicLibrary: d.target,
},
});
await ve.initialize([]);

let tx = await ve.createLock('0x0000000000000000000000000000000000000000', '10000000000000000000', 126144000, {
value: '10000000000000000000',
Expand All @@ -37,7 +38,8 @@ describe('Flow', function () {
const rewardsDistributor = await ethers.deployContract('RewardsDistributor', [ve.target]);
await rewardsDistributor.waitForDeployment();

const vault = await ethers.deployContract('Vault', [voter.target, ve.target, rewardsDistributor.target]);
const vault = await ethers.deployContract('Vault');
await vault.initialize(voter.target, ve.target, rewardsDistributor.target);

await voter.initialize([], vault.target);
await rewardsDistributor.setVault(vault.target);
Expand Down

0 comments on commit d84723a

Please sign in to comment.