Eric Mastro 321132b6fa clean up tests
1. Replace all instances of `now()` with `await currentTime()` to get a more accurate representation of time from the block timestamp. Update examples.js to be async.
2. Move `RequestState` to `marketplace.js`
3. Delete `TestStorage` as `slashAmount` function no longer needed.
2022-10-25 12:38:19 +11:00

37 lines
949 B
JavaScript

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("Storage", { 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 = ["Storage"]
module.exports.dependencies = ["TestToken"]