[fix] fix test deployment
This commit is contained in:
parent
cf0ab20b6c
commit
1ab6d700af
|
@ -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"]
|
||||||
|
|
|
@ -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"]
|
Loading…
Reference in New Issue