Mint test tokens for both client and host
This commit is contained in:
parent
54cc2987df
commit
afad0e49ec
|
@ -4,7 +4,9 @@ pragma solidity ^0.8.0;
|
||||||
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
|
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
|
||||||
|
|
||||||
contract TestToken is ERC20 {
|
contract TestToken is ERC20 {
|
||||||
constructor() ERC20("TestToken", "TST") {
|
constructor(address[] memory holders) ERC20("TestToken", "TST") {
|
||||||
_mint(msg.sender, 1000);
|
for (uint i=0; i<holders.length; i++) {
|
||||||
|
_mint(holders[i], 1000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ describe("Stakes", function () {
|
||||||
[host] = await ethers.getSigners()
|
[host] = await ethers.getSigners()
|
||||||
const Stakes = await ethers.getContractFactory("TestStakes")
|
const Stakes = await ethers.getContractFactory("TestStakes")
|
||||||
const TestToken = await ethers.getContractFactory("TestToken")
|
const TestToken = await ethers.getContractFactory("TestToken")
|
||||||
token = await TestToken.deploy()
|
token = await TestToken.deploy([host.address])
|
||||||
stakes = await Stakes.deploy(token.address)
|
stakes = await Stakes.deploy(token.address)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ describe("Storage", function () {
|
||||||
[client, host] = await ethers.getSigners()
|
[client, host] = await ethers.getSigners()
|
||||||
let Token = await ethers.getContractFactory("TestToken")
|
let Token = await ethers.getContractFactory("TestToken")
|
||||||
let StorageContracts = await ethers.getContractFactory("Storage")
|
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)
|
storage = await StorageContracts.deploy(token.address, stakeAmount)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue