mirror of
https://github.com/status-im/dagger-contracts.git
synced 2025-01-21 03:49:10 +00:00
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 {
|
contract TestToken is ERC20 {
|
||||||
constructor() ERC20("TestToken", "TST") {}
|
constructor() ERC20("TestToken", "TST") {}
|
||||||
|
|
||||||
function mint(address[] memory holders, uint amount) public {
|
function mint(address holder, uint amount) public {
|
||||||
for (uint i=0; i<holders.length; i++) {
|
_mint(holder, amount);
|
||||||
_mint(holders[i], amount);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ describe("Stakes", function () {
|
|||||||
const TestToken = await ethers.getContractFactory("TestToken")
|
const TestToken = await ethers.getContractFactory("TestToken")
|
||||||
token = await TestToken.deploy()
|
token = await TestToken.deploy()
|
||||||
stakes = await Stakes.deploy(token.address)
|
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 () {
|
it("has zero stakes initially", async function () {
|
||||||
|
@ -19,7 +19,8 @@ describe("Storage", function () {
|
|||||||
await deployments.fixture(['TestToken', 'Storage'])
|
await deployments.fixture(['TestToken', 'Storage'])
|
||||||
token = await ethers.getContract('TestToken')
|
token = await ethers.getContract('TestToken')
|
||||||
storage = await ethers.getContract('Storage')
|
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()
|
stakeAmount = await storage.stakeAmount()
|
||||||
slashMisses = await storage.slashMisses()
|
slashMisses = await storage.slashMisses()
|
||||||
slashPercentage = await storage.slashPercentage()
|
slashPercentage = await storage.slashPercentage()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user