[fix] fix test deployment

This commit is contained in:
Eric Mastro 2022-08-25 13:21:50 +10:00 committed by Eric Mastro
parent cf0ab20b6c
commit 1ab6d700af
2 changed files with 38 additions and 2 deletions

View File

@ -18,7 +18,7 @@ async function deployStorage({ deployments, getNamedAccounts }) {
minCollateralThreshold, minCollateralThreshold,
] ]
const { deployer } = await getNamedAccounts() const { deployer } = await getNamedAccounts()
await deployments.deploy("TestStorage", { args, from: deployer }) await deployments.deploy("Storage", { args, from: deployer })
} }
async function mine256blocks({ network, ethers }) { async function mine256blocks({ network, ethers }) {
@ -32,5 +32,5 @@ module.exports = async (environment) => {
await deployStorage(environment) await deployStorage(environment)
} }
module.exports.tags = ["TestStorage"] module.exports.tags = ["Storage"]
module.exports.dependencies = ["TestToken"] module.exports.dependencies = ["TestToken"]

36
deploy/test/storage.js Normal file
View File

@ -0,0 +1,36 @@
async function deployStorage({ deployments, getNamedAccounts }) {
const token = await deployments.get("TestToken")
const proofPeriod = 10
const proofTimeout = 5
const proofDowntime = 64
const collateralAmount = 100
const slashMisses = 3
const slashPercentage = 10
const minCollateralThreshold = 40
const args = [
token.address,
proofPeriod,
proofTimeout,
proofDowntime,
collateralAmount,
slashMisses,
slashPercentage,
minCollateralThreshold,
]
const { deployer } = await getNamedAccounts()
await deployments.deploy("TestStorage", { args, from: deployer })
}
async function mine256blocks({ network, ethers }) {
if (network.tags.local) {
await ethers.provider.send("hardhat_mine", ["0x100"])
}
}
module.exports = async (environment) => {
await mine256blocks(environment)
await deployStorage(environment)
}
module.exports.tags = ["TestStorage"]
module.exports.dependencies = ["TestToken"]