Simplify signature of TestToken.mint
To be compatible with nim-web3, which doesn't support arrays in a method signature.
This commit is contained in:
parent
a794141308
commit
b9a9be350a
|
@ -6,9 +6,7 @@ import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
|
|||
contract TestToken is ERC20 {
|
||||
constructor() ERC20("TestToken", "TST") {}
|
||||
|
||||
function mint(address[] memory holders, uint amount) public {
|
||||
for (uint i=0; i<holders.length; i++) {
|
||||
_mint(holders[i], amount);
|
||||
}
|
||||
function mint(address holder, uint amount) public {
|
||||
_mint(holder, amount);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ describe("Stakes", function () {
|
|||
const TestToken = await ethers.getContractFactory("TestToken")
|
||||
token = await TestToken.deploy()
|
||||
stakes = await Stakes.deploy(token.address)
|
||||
await token.mint([host.address], 1000)
|
||||
await token.mint(host.address, 1000)
|
||||
})
|
||||
|
||||
it("has zero stakes initially", async function () {
|
||||
|
|
|
@ -19,7 +19,8 @@ describe("Storage", function () {
|
|||
await deployments.fixture(['TestToken', 'Storage'])
|
||||
token = await ethers.getContract('TestToken')
|
||||
storage = await ethers.getContract('Storage')
|
||||
await token.mint([client.address, host.address], 1000)
|
||||
await token.mint(client.address, 1000)
|
||||
await token.mint(host.address, 1000)
|
||||
stakeAmount = await storage.stakeAmount()
|
||||
slashMisses = await storage.slashMisses()
|
||||
slashPercentage = await storage.slashPercentage()
|
||||
|
|
Loading…
Reference in New Issue