-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
53 additions
and
129 deletions.
There are no files selected for viewing
129 changes: 0 additions & 129 deletions
129
subgraphs/venus-governance/tests/integration/utils/deploy.ts
This file was deleted.
Oops, something went wrong.
53 changes: 53 additions & 0 deletions
53
subgraphs/venus-governance/tests/integration/utils/fixtures.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { ethers } from 'hardhat'; | ||
|
||
const xvsVaultFixture = async () => { | ||
const xvs = await ethers.getContract('XVS'); | ||
const xvsVault = await ethers.getContract('XVSVault'); | ||
const xvsVaultProxy = await ethers.getContract('XVSVaultProxy'); | ||
const xvsStore = await ethers.getContract('XVSStore'); | ||
const timelock = await ethers.getContract('Timelock'); | ||
|
||
// approve xvs spending to xvs vault | ||
const approvalAmount = ethers.BigNumber.from(ethers.BigNumber.from(10).pow(10)) | ||
.mul(ethers.BigNumber.from(10).pow(18)) | ||
.toString(); | ||
await xvs.approve(xvsVault.address, approvalAmount); | ||
|
||
// deposit xvs to xvs vault | ||
const amount = ethers.BigNumber.from(ethers.BigNumber.from(7).pow(5)) | ||
.mul(ethers.BigNumber.from(10).pow(18)) | ||
.toString(); | ||
await xvsVault.deposit(xvs.address, 0, amount); | ||
return { | ||
xvsVault, | ||
xvsVaultProxy, | ||
xvs, | ||
xvsStore, | ||
timelock, | ||
}; | ||
}; | ||
|
||
const governorFixture = async () => { | ||
const governorAlpha = await ethers.getContract('GovernorAlpha'); | ||
|
||
const governorAlpha2 = await ethers.getContract('GovernorAlpha2'); | ||
|
||
return { | ||
governorAlpha, | ||
governorAlpha2, | ||
}; | ||
}; | ||
|
||
async function deploy() { | ||
const { timelock, xvsVault, xvs } = await xvsVaultFixture(); | ||
const { governorAlpha, governorAlpha2 } = await governorFixture(); | ||
return { | ||
governorAlpha, | ||
governorAlpha2, | ||
timelock, | ||
xvs, | ||
xvsVault, | ||
}; | ||
} | ||
|
||
export default deploy; |