Mint test tokens for both client and host

This commit is contained in:
Mark Spanbroek 2021-11-04 11:32:21 +01:00
parent 54cc2987df
commit afad0e49ec
3 changed files with 6 additions and 4 deletions

View File

@ -4,7 +4,9 @@ pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract TestToken is ERC20 {
constructor() ERC20("TestToken", "TST") {
_mint(msg.sender, 1000);
constructor(address[] memory holders) ERC20("TestToken", "TST") {
for (uint i=0; i<holders.length; i++) {
_mint(holders[i], 1000);
}
}
}

View File

@ -11,7 +11,7 @@ describe("Stakes", function () {
[host] = await ethers.getSigners()
const Stakes = await ethers.getContractFactory("TestStakes")
const TestToken = await ethers.getContractFactory("TestToken")
token = await TestToken.deploy()
token = await TestToken.deploy([host.address])
stakes = await Stakes.deploy(token.address)
})

View File

@ -18,7 +18,7 @@ describe("Storage", function () {
[client, host] = await ethers.getSigners()
let Token = await ethers.getContractFactory("TestToken")
let StorageContracts = await ethers.getContractFactory("Storage")
token = await Token.connect(host).deploy()
token = await Token.deploy([client.address, host.address])
storage = await StorageContracts.deploy(token.address, stakeAmount)
})