fix tests, ci

This commit is contained in:
poma 2021-02-11 10:00:53 +03:00
parent 346ffcee3c
commit a359e86f85
No known key found for this signature in database
GPG key ID: BA20CB01FE165657
13 changed files with 309 additions and 79 deletions

View file

@ -19,7 +19,7 @@ contract ERC20Tornado is Tornado {
constructor(
IVerifier _verifier,
Hasher _hasher,
IHasher _hasher,
uint256 _denomination,
uint32 _merkleTreeHeight,
address _token

View file

@ -17,7 +17,7 @@ import "./Tornado.sol";
contract ETHTornado is Tornado {
constructor(
IVerifier _verifier,
Hasher _hasher,
IHasher _hasher,
uint256 _denomination,
uint32 _merkleTreeHeight
) public Tornado(_verifier, _hasher, _denomination, _merkleTreeHeight) {}

View file

@ -12,7 +12,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
interface Hasher {
interface IHasher {
function MiMCSponge(uint256 in_xL, uint256 in_xR) external pure returns (uint256 xL, uint256 xR);
}
@ -30,9 +30,9 @@ contract MerkleTreeWithHistory {
uint32 public nextIndex = 0;
uint32 public constant ROOT_HISTORY_SIZE = 100;
bytes32[ROOT_HISTORY_SIZE] public roots;
Hasher public immutable hasher;
IHasher public immutable hasher;
constructor(uint32 _treeLevels, Hasher _hasher) public {
constructor(uint32 _treeLevels, IHasher _hasher) public {
require(_treeLevels > 0, "_treeLevels should be greater than zero");
require(_treeLevels < 32, "_treeLevels should be less than 32");
levels = _treeLevels;
@ -56,7 +56,7 @@ contract MerkleTreeWithHistory {
@dev Hash 2 tree leaves, returns MiMC(_left, _right)
*/
function hashLeftRight(
Hasher _hasher,
IHasher _hasher,
bytes32 _left,
bytes32 _right
) public pure returns (bytes32) {

View file

@ -3,4 +3,8 @@ pragma solidity ^0.6.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract ERC20Mock is ERC20("DAIMock", "DAIM") {}
contract ERC20Mock is ERC20("DAIMock", "DAIM") {
function mint(address account, uint256 amount) public {
_mint(account, amount);
}
}

View file

@ -4,7 +4,7 @@ pragma solidity ^0.6.0;
import "../MerkleTreeWithHistory.sol";
contract MerkleTreeWithHistoryMock is MerkleTreeWithHistory {
constructor(uint32 _treeLevels, Hasher _hasher) public MerkleTreeWithHistory(_treeLevels, _hasher) {}
constructor(uint32 _treeLevels, IHasher _hasher) public MerkleTreeWithHistory(_treeLevels, _hasher) {}
function insert(bytes32 _leaf) public {
_insert(_leaf);

View file

@ -46,7 +46,7 @@ abstract contract Tornado is MerkleTreeWithHistory, ReentrancyGuard {
*/
constructor(
IVerifier _verifier,
Hasher _hasher,
IHasher _hasher,
uint256 _denomination,
uint32 _merkleTreeHeight
) public MerkleTreeWithHistory(_merkleTreeHeight, _hasher) {